2016-09-07, 07:04:57
Not sure why he is using a callback for content, there, very confusing.
Plugin is also setting data_index after all the globals are set so it is pretty much useless.
If you want to set all your variables you need to set globals, you can also just echo your content, since the plugin is also doing a ob_get_contents ( it looks like you can match a bunch of routes and it aggregates all the content togather ) but this does not actually work atm, because he is only using data_index->content not global $content..
I honestly have no idea how the above code even works, it only works because of references which is bad.
so as long as you understand these problems it works well.
personally id stick with the globals.
Plugin is also setting data_index after all the globals are set so it is pretty much useless.
If you want to set all your variables you need to set globals, you can also just echo your content, since the plugin is also doing a ob_get_contents ( it looks like you can match a bunch of routes and it aggregates all the content togather ) but this does not actually work atm, because he is only using data_index->content not global $content..
I honestly have no idea how the above code even works, it only works because of references which is bad.
so as long as you understand these problems it works well.
personally id stick with the globals.
PHP Code:
<?php
GLOBAL $title,$content;
$title = "MY TITLE";
$content = "MY CONTENT";
?>