Support

Account

Forum Replies Created

  • Here is the solution I have used to remove the stray p tags when using shortcodes in the ACF WYSIWYG (put that in your functions file).

    function wpex_clean_shortcodes($content){   
        $array = array (
            '<p>[' => '[', 
            ']</p>' => ']', 
            ']<br />' => ']'
        );
        $content = strtr($content, $array);
        return $content;
    }
    add_filter('acf_the_content', 'wpex_clean_shortcodes');?>

    So far, I have not had any problems with this solution.

Viewing 1 post (of 1 total)