177 posts
  • Bought between 1 and 9 items
  • Referred between 1 and 9 users
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 5 000 and 10 000 dollars
  • Romania
DanThemes says

Thanks for your help. :)

11 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 2-3 years
  • Russian Federation
  • Sold between 1 000 and 5 000 dollars
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:

https://gist.github.com/bitfade/4555047

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 :)

by
by
by
by
by
by