[Plugin: Global Content Blocks] Adding a filter for content block
-
Hello Benz1,
first thanks a lot for this awesome plugin, exactly what I need. There is just one enhancement I would really appreciate-
Could you add a filter to the returned block before it is inserted into page? That way any plugin/template developer could adjust it anyway he needs, without need to modify your plugin. Something like this would be really cool:
Line #186 in global-content-blocks.php, instead of
if($record->type!="php") {
return htmlspecialchars_decode(stripslashes($record->value));
}
have this:
if($record->type!="php") {
return apply_filters('gcb_block_output', htmlspecialchars_decode(stripslashes($record->value)));
}
.. and same for the PHP output on line #196.
One of the reasons I need this is to use shortcodes even in the content blocks in your plugin. There were already requests for this here and here.
If you added the filter I suggest, then this would be a piece of cake – you would just add this into your functions.php and all shortcodes in Global content blocks would be processed by the shortcode engine:
add_filter('gcb_block_output', 'do_shortcode');
Do you think you could implement this and release it with the new version ? I think a lot of people would appreciate it.
Thanks and have a nice day.
https://www.ads-software.com/extend/plugins/global-content-blocks/
- The topic ‘[Plugin: Global Content Blocks] Adding a filter for content block’ is closed to new replies.