• I had a custom modified version of the plugin that just got overwritten and had a bunch of pages start displaying things they shouldn’t. My main change was to change return $snippet; to return do_shortcode($snippet); in the rhs_raw_html_snippet_shortcode() function.

    The purpose of this is to expand any included shortcodes in the outputted content stored in Raw HTML Snippet shortcodes. This turns this plugin into a superpower. ??

    Love this plugin, thank you for your work on it, and if you are able to add do_shortcode() to the output it would be much appreciated.

    My workaround for now is to add a mu-plugins file with this to filter the output of the plugin, but I’d rather it just be added directly to the plugin and avoid having to add this file.

    
    <?php
    /**
     * Fix for Raw HTML Snippets shortcode plugin not expanding shortcodes
     * in the output of any [raw_html_snippet] shortcode
     *
     * @param string $output The output from the shortcode
     * @param string $tag The name of the shortcode
     *
     * @return string The modified output
     */
    function expand_shortcodes_in_raw_html_snippet ( $output, $tag ) {
            if ( 'raw_html_snippet' !== $tag ) {
                    return $output;
            }
            return do_shortcode($output);
    }
    add_filter('do_shortcode_tag', 'expand_shortcodes_in_raw_html_snippet', 10, 2);
    
    
  • The topic ‘Please add do_shortcode() to the $content output’ is closed to new replies.