244 posts
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+3 more
DanThemes says

Thanks for your help. :)

11 posts
  • Has been part of the Envato Community for over 3 years
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in Europe
+1 more
Matyushen says

This code is no longer accepted by reviewers:
add_filter('the_content', 'shortcode_empty_paragraph_fix');
function shortcode_empty_paragraph_fix($content)
    $array = array (
        '<p>[' => '[', 
        ']</p>' => ']', 
        ']<br />' => ']'

    $content = strtr($content, $array);

    return $content;
What do you guys use instead of it?

We use this instead this little nifty function thanks to bitfade:


This is used because you are only using on your shortcodes so that any 3rd party shortcodes are not affected by this which is why the other code is not allowed, because it also effects 3rd party plugins.

Thanks for the link :)