737 posts
  • Has referred 500+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+7 more
mordauk says

@cosmincotor there really isn’t a great code snippet out there. I would personally recommend not trying to use any code snippet as every single one of them goes against what should be happening.

I also wouldn’t be including short codes (except very specialized ones in your themes). For example, if you want to add columns, suggest your users install this plugin: https://github.com/justintadlock/grid-columns

The problem is actually an issue with WordPress, not themes (except themes that try to fix it). The best thing to do is work on fixing the issue in core and submit a patch.

2210 posts
  • Has referred 200+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+13 more
mpc says

Would be nice to provide the fix since you started the thread and others may be intersted :d

I have used this plugin, those of the users who will have a problem with the paragraph tags and breaks added to the shortcodes will use it and the others wont. Maybe it’s not the best… next time I will try the solution from this topic ;)

334 posts
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
+4 more
cosmincotor says

@cosmincotor there really isn’t a great code snippet out there. I would personally recommend not trying to use any code snippet as every single one of them goes against what should be happening.

I also wouldn’t be including short codes (except very specialized ones in your themes). For example, if you want to add columns, suggest your users install this plugin: https://github.com/justintadlock/grid-columns

The problem is actually an issue with WordPress, not themes (except themes that try to fix it). The best thing to do is work on fixing the issue in core and submit a patch.

Well, I guess I’ll have to re-think the shortcodes (which ones are absolutely necessary), and hopefully WP will receive an update that deals with this issue.

Thanks :)

no-thumbnail
AvantInnovations Recent Posts Threads Started
1 post
  • Has been part of the Envato Community for over 6 years
  • Has referred 1+ members
  • Has collected 10+ items on Envato Market
AvantInnovations says


@cosmincotor there really isn’t a great code snippet out there. I would personally recommend not trying to use any code snippet as every single one of them goes against what should be happening.

I also wouldn’t be including short codes (except very specialized ones in your themes). For example, if you want to add columns, suggest your users install this plugin: https://github.com/justintadlock/grid-columns

The problem is actually an issue with WordPress, not themes (except themes that try to fix it). The best thing to do is work on fixing the issue in core and submit a patch.

Well, I guess I’ll have to re-think the shortcodes (which ones are absolutely necessary), and hopefully WP will receive an update that deals with this issue.

Thanks :)

I wouldnt hold your breath

1155 posts
  • Has been a beta tester for an Envato feature
  • Has sold $10,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Has referred 1+ members
+6 more
greenline says
There are many best-selling TF themes which still use for instance: $new_content .= wptexturize(wpautop($piece));

This forces wpautop and messes up the content generated by the new plugin I am working at. It adds <p></p> to my generated content and I haven’t found any good solution yet to get rid of the <p></p> added

I thought theme authors are not allowed to force wpautop?? Or are they?

13 posts
  • Has been part of the Envato Community for over 3 years
  • Has collected 10+ items on Envato Market
  • Located in United Kingdom
ruudbwai says

So what’s the verdict, I’m writing a theme, and definitely need to use the shortcode empty paragraph fix posted…will theme get rejected because of this?

Otherwise the wpautop wreaks havoc with my shortcodes :p

653 posts
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+5 more
UBLThemes says

Hi, just had a theme soft rejected and one of the reasons was for using:

function shortcode_empty_paragraph_fix($content){   
    $array = array (
        '<p>[' => '[', 
        ']</p>' => ']', 
        ']<br />' => ']'
    );

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

Ive always used this but it looks like this is no longer allowed, what are you doing to do this?

1509 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+2 more
OriginalEXE says
653 posts
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+5 more
UBLThemes says

Check this out: https://gist.github.com/bitfade/4555047

That is basically doing the same thing, so why would that pass and the one I am doing not?

1509 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+2 more
OriginalEXE says


Check this out: https://gist.github.com/bitfade/4555047
That is basically doing the same thing, so why would that pass and the one I am doing not?
There is one big difference, your code affects all shortcodes, but with the code I linked you have the control over what shortcodes get “cleaned”

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by