Closed rvanlaak closed 9 years ago
@Rvanlaak two bundle use a different approach. The first one (HypebeastWordpressBundle
) loads entire WordPress into Symfony, thus you can reuse almost everything in WordPress. This is good if you want to reuse your code from WordPress, but it also introduced other issues. It is like loading two framework in one website.
However in the new KayueWordpressBundle
it does not require WordPress at all. It just read the WordPress database. So it is impossible to add back the magic methods because in this bundle we do not load any WordPress functions at all.
I suggest you continue to use HypebeastWordpressBundle
if you want to reuse WordPress functions.
I understand your point of view, but in that case you can't deprecate the other library right? What do you actually think about the hooks all plugins add?
@Rvanlaak You are right. I just aren't maintaining the other library anymore.
I only use WordPress plugin to enhance backend, this is why KayueWordpressBundle
works well for me.
Currently the most used class I make use of is the
WordpressTwigExtension
from the deprecated predecessor of this library. In my opinion this extension worked great because it enabled me to very easily integrate Wordpress in my Symfony application. https://github.com/kayue/WordpressBundle/blob/master/Extensions/WordpressTwigExtension.phpI see you've removed the magic
__call()
function from the currentWordpressTwigExtension
, which took care of handling all known Codex functions in Twig https://github.com/kayue/KayueWordpressBundle/blob/master/Twig/Extension/WordpressExtension.phpFor the sake of backwards compatibility, wouldn't it be a good idea to reintroduce the magic function? Probably the most important reason for not doing this is because then the entire core has to be loaded?
I think it always will be needed to wake up the core, since there are a lot of plugins that add hooks to the functions, and introduce their own functions. Take the WPML internationalization plugin as example, which adds hooks to determine the correct language.
Do you've got another idea how to take care of the hooks, aside of adding the magic __call() again?