Support » Plugins and Hacks » Global Content Blocks » [Plugin: Global Content Blocks] Adding a filter for content block

  • Resolved Jan Zikmund

    (@verify)


    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.

    http://wordpress.org/extend/plugins/global-content-blocks/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author benz1

    (@benz1)


    Hi and thanks for the clear explanation. I’ve gone ahead and done this and will upload to the repository shortly but if you want to send me your email address via here I can send you the new version to test before I upload it.

    Plugin Author benz1

    (@benz1)


    FYI, the new version (1.4) of the plugin has been updated on the repository.

    Please feel free to give the plugin a rating at http://wordpress.org/extend/plugins/global-content-blocks/.

    Thanks,
    Benz1

    Hello, thanks a lot, it’s great that you can respond so fast.
    The new plugin version is working great, it’s exactly what I wanted. I just rated it by five stars and I am sure I will use it again.

    Thanks and have a nice day
    Z.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Global Content Blocks] Adding a filter for content block’ is closed to new replies.