Support » Plugins » [Plugin: Boilerplate] Is there an equivalent of do_shortcode() for boilerplates?

  • When I try to display content from a page that includes a boilerplate on a different page, the boilerplate isn’t processed, ‘[boilerplate plate = “foo”]’ appears right there on the page. Is there an equivalent of do_shortcode for wp-boilerplate?

    If not, how would I write my own such function?

Viewing 5 replies - 1 through 5 (of 5 total)
  • No, that doesn’t do it.

    I’ve got a function, called by a shortcode, that takes the content of all pages with the tag “soon” and puts them on the News page. Part of the function runs like this:

    $soon_text .= $soonlink . get_the_title().'</a></h3>';
    $thiscontent = get_the_content();
    $coded_content = do_shortcode( $thiscontent );
    $soon_text .= $coded_content;

    If there is a shortcode inside that page’s content, “do_shortcode” processes it so it displays properly on the News page.

    However, if I have a boilerplate on that page, it is *not* processed, and [boilerplate plate = "foo"] is right there for all to see.

    I need a way to nest the boilerplate within a *shortcode*, not just within another boilerplate.

    Boilerplate is not a true shortcode it is a filter. This is done because shortcodes are low priority, lower than filters. This would mean the inserted text would not be filtered, which in most cases would not be good.
    If the do_action does not work in your situation you could try

    $coded_content = apply_filters( ‘the_content’, $thiscontent );

    It might achieve what you need.

    YES! That worked! Thank you very much.

    Hey there, having an issue with this, Shortcode works fine in the content, when placed in a template (I’ve used the do_action as described on your site) with no joy – any help would be greatly appreciated.

    Other than this snag an all round awesome plugin.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Boilerplate] Is there an equivalent of do_shortcode() for boilerplates?’ is closed to new replies.