Hi Mat,
Thanks for your reply.
I think instead of supporting my custom code that you might misunderstand, I would like to suggest that the do_magic_tag
should also expose in order to work with the action neve_magic_tags_config
together because it is designed to be extended but it is not yet completed or with the design incompletion.
Because your current design means to execute the magic tag with preg_replace_callback
and run the magic tag if it is a methods in the instance. But since there is no other way to just put a function into the class Magic_Tag in php. So your design only allow the do the upper half currently.
For another half, you might consider to adding a filter to the return value of the do_magic_tags which will could work together with your original idea for extension.
eg.
$return = apply_filters( 'neve_do_magic_tags_callback_return', preg_replace_callback(
'/\\{\s?\b(?:' . self::$magic_tag_regex . ')\b\s?\\}/',
[
$this,
'do_magic_tag',
],
$input
));`
I have suggested some other plugins before for improvement and thanks for the author’s appreciation and updates accordingly and generously.
Hope it also helps to make Neve even greater user experience for all.
Thanks again for your time and making such an awesome product!