3711 posts Ruben Bristian
  • Sells items exclusively on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
+10 more
KrownThemes says

I am aware of all the answers from the other threads regarding this issue(especially bitfade’s class and the tutorial with the shortcodes filter order). I’m just trying an alternative and wanted to be sure that i can pass review:

 function rbFilterShortcodes($content){
     $filtered = str_replace(
         array(
             'autop"></p>',
             '<p></p>',
             '<p></div>'
         ),
         array(
             'autop">',
             '',
             '</div>'
         ),
         $content);
     return $filtered;
 }

add_filter("the_content", "rbFilterShortcodes", 99);

All of my shortcodes have the “autop” class at the end, so this is how i’m searching for them.. Also, there are more weird stuff happening, such as the last two filters..

Is it safe to work like this?

3711 posts Ruben Bristian
  • Sells items exclusively on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
+10 more
KrownThemes says

3711 posts Ruben Bristian
  • Sells items exclusively on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
+10 more
KrownThemes says

bump! :D

194 posts Dreams Money Can Buy
  • Has sold $1M+ on Envato Market and is now a Power Elite Author
  • Power Elite Author: Sold more than $1M on Envato Market
  • Has referred 200+ members
  • Has collected 10+ items on Envato Market
+5 more
SwiftIdeas says

I’m not sure if the reviewers would have anything against it, but does it work well for you?

- Ed

3711 posts Ruben Bristian
  • Sells items exclusively on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
+10 more
KrownThemes says

I’m not sure if the reviewers would have anything against it, but does it work well for you? - Ed

Thanks :)

It works really well for me.. Actually, it works the best, since there are always some weird paragraphs appearing before or after elements.. So i can also fix stuff like: <p></section> for example..

194 posts Dreams Money Can Buy
  • Has sold $1M+ on Envato Market and is now a Power Elite Author
  • Power Elite Author: Sold more than $1M on Envato Market
  • Has referred 200+ members
  • Has collected 10+ items on Envato Market
+5 more
SwiftIdeas says

I have had issues before where shortcodes on the same line as a paragraph would cause erroneous tags. Seems that it would also be better as it wouldn’t interfere with any 3rd party shortcodes!

So for every shortcode you create, you have a class on the outer wrap of “autop”?

Might need to take a little look at re-working the way we do it ;)

- Ed

3711 posts Ruben Bristian
  • Sells items exclusively on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
+10 more
KrownThemes says

So for every shortcode you create, you have a class on the outer wrap of “autop”?

yep .. :D

38 posts
  • Has referred 50+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+3 more
wpstrong says

My way is using jQuery :

    
//Clean empty p elements

$('#content p:empty').remove();

It helps a bit

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