I wanted to know how I can create shortcodes in pure php (I will not use wordpress and its plugins).
I do not intend to use functions in php for this purpose. I would like to create a structure where I could name a code in php and when call on the page it would return all content previously defined.
For example, in the administrative area of the site it would look like this:
Shortcode name: pt-so
Content of the above mentioned shortcode:
<?php
// Aqui poderia usar qualquer coisa no php, usar while, functions, etc.
echo "<p>Bem-vindo ao Stack Overflow em Português!</p>";
?>
php file
<html>
<head>
<title>Teste</title>
</head>
<body>
<!-- Chamando o shortcode -->
[pt-so]
</body>
</html>
In the php code where the shortcode call is located, it will print the paragraph with welcome. As I will make a system with administrative area, this would be one of the resources that the same system would have. I just want to understand how I can make this call a shortcode on my system / site page that will be visible to the public.
Note: I tried to extract the answer in this question, but I could not.