• I believe the Gutenberg html block will not support shortcode “as is or out of the box”.

    However, can I securely add a custom plugin or use the “code snippet” plugin to change this function so that a widget_text can support a shortcode?

    could this example be used as a custom plugin to add a filter to the functions file (and if so, is it written correctly):

    <?php
    /*
    Plugin Name: Site Plugin for Custom WP Edits
    Description: Site specific code changes for customwpcedits.com
    */
    /* Start Adding Functions Below this Line */
      
    add_filter( 'widget_text', 'do_shortcode' );
    
      
    /* Stop Adding Functions Below this Line */
    ?>

    Thank you for any help you can provide!

    _Cindy

    • This topic was modified 2 years, 11 months ago by Cindy Barnard.
Viewing 2 replies - 1 through 2 (of 2 total)
  • What’s the reason for doing this when there’s a shortcode block?

    Moderator bcworkz

    (@bcworkz)

    It’s convenient to be able to type a shortcode directly into the current text instead of needing to add a separate block for the shortcode. Lazy? Perhaps, but that’s how I roll.

    Since WP changed to block based widgets I’m not so sure any more, but your code ought to work as expected. Try it out and see ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘html block and shortcode block’ is closed to new replies.