57 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Had an item that was trending
  • Has sold $125,000+ on Envato Market
  • Has collected 50+ items on Envato Market
+4 more
ab-themes
says
Is this way of stripping empty p tags on specific shortcodes allowed?
https://gist.github.com/bitfade/4555047
Tnx!
1754 posts How's the surf doing?
  • Power Elite Author: Sold more than $1M on Envato Market
  • Had an item that was trending
  • Became a Top 20 Author of the Month
  • Achieved the monthly Community Superstar Award
+9 more
tommusrhodus
says
jQuery(document).ready(function(){ jQuery('p:empty').remove(); });
148 posts
  • Has been part of the Envato Community for over 2 years
loveetc
says

jQuery(document).ready(function(){ jQuery('p:empty').remove(); });

That’s very ugly way to do that. You should use remove those tags in shortcodes properly without messing with WordPress core code.

1 post
  • Has been part of the Envato Community for over 1 year
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+2 more
MasonThemes
says


jQuery(document).ready(function(){ jQuery('p:empty').remove(); });
That’s very ugly way to do that. You should use remove those tags in shortcodes properly without messing with WordPress core code.

^^That doesn’t touch the core..

Whilst I admit it’s not the most elegant solution in the world, it certainly does exactly what is required without having to filter the_content output in any way.

382 posts
  • Had an item that became a weekly top seller
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Located in New Zealand
+6 more
PixelStores
says

I believe its allowed as long as you don’t remove the two filters, wpautop and wptexturize, like the code below.

remove_filter('the_content', 'wpautop');
remove_filter('the_content', 'wptexturize');

~ Matt

148 posts
  • Has been part of the Envato Community for over 2 years
loveetc
says



jQuery(document).ready(function(){ jQuery('p:empty').remove(); });
That’s very ugly way to do that. You should use remove those tags in shortcodes properly without messing with WordPress core code.

^^That doesn’t touch the core..

Whilst I admit it’s not the most elegant solution in the world, it certainly does exactly what is required without having to filter the_content output in any way.

Sure, it doesn’t, but I said you can use the code which can do that more efficiently. Why to first make mess and then clean up with extra js code? Why not doing it clean way at first place?

57 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Had an item that was trending
  • Has sold $125,000+ on Envato Market
  • Has collected 50+ items on Envato Market
+4 more
ab-themes
says

In WordPress Theme Submission Requirements says:
Modification of filters in wptexturize() is not allowed.
Modification of filters in wpautop is not allowed.

And that are only two points regarding filtering, so i would say bitfade’s code is allowed..

jQuery is easy way, but i don’t like to echo something and then hide it, in my opinion it is much better to filter content, especially with bitfade’s code as it doesn’t mess up anything besides my shortcodes..

1754 posts How's the surf doing?
  • Power Elite Author: Sold more than $1M on Envato Market
  • Had an item that was trending
  • Became a Top 20 Author of the Month
  • Achieved the monthly Community Superstar Award
+9 more
tommusrhodus
says

Sure, it doesn’t, but I said you can use the code which can do that more efficiently. Why to first make mess and then clean up with extra js code? Why not doing it clean way at first place?

Don’t get me wrong, I totally agree, but either way you’re just trying to clean up the mess that WordPress outputs by default, one way involves removing the dead tags from the DOM (jQuery) and the other involves filtering the entire content (PHP) – whilst I agree that the PHP way is definitely neater, the jQuery method is certainly more comprehensive.

501 posts
  • Has referred 1000+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Became a Top 20 Author of the Month
+10 more
pixelentity
says

Our latest theme which includes the mentioned code was held for a few days because of it. It was ultimately confirmed by the review team that it can be used and the theme was approved as is.

57 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Had an item that was trending
  • Has sold $125,000+ on Envato Market
  • Has collected 50+ items on Envato Market
+4 more
ab-themes
says

Our latest theme which includes the mentioned code was held for a few days because of it. It was ultimately confirmed by the review team that it can be used and the theme was approved as is.
The bitfade’s code i asked for or jQuery code?

I tried both solutions for some time, and now i like jQuery more :)
by
by
by
by
by
by