46 posts
  • Has been part of the Envato Community for over 3 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+2 more
MonkeeThemes
says

Hey guys,

remove_filter seems to be bad practice as it might break other plugins from working. Do you know any other solution to remove p tags to appear before and after the content page?

Thanks!

1140 posts It's in the pipeline!
  • Became a Top 20 Author of the Month
  • Had an item that was trending
  • Had an item that became a weekly top seller
  • Has sold $750,000+ on Envato Market
+9 more
purethemes
says
46 posts
  • Has been part of the Envato Community for over 3 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+2 more
MonkeeThemes
says
414 posts
  • Located in United States
  • Power Elite Author: Sold more than $1M on Envato Market
  • Had an item that was trending
  • Became a Top 20 Author of the Month
+8 more
WPExplorer
says

This is what I use:

function wpex_clean_shortcodes($content){   
    $array = array (
        '<p>[' => '[', 
        ']</p>' => ']', 
        ']<br />' => ']'
    );
    $content = strtr($content, $array);
    return $content;
}
add_filter('the_content', 'wpex_clean_shortcodes');
1140 posts It's in the pipeline!
  • Became a Top 20 Author of the Month
  • Had an item that was trending
  • Had an item that became a weekly top seller
  • Has sold $750,000+ on Envato Market
+9 more
purethemes
says

@WPExplorer

really? on your themes here? I was rejected for this twice.

326 posts
  • Has sold $40,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Has been part of the Envato Community for over 3 years
  • Sells items exclusively on Envato Market
PersianArt
says

and what is your Idea about this

remove_filter( 'the_content', 'wpautop' );
add_filter( 'the_content', 'wpautop' , 99);
add_filter( 'the_content', 'shortcode_unautop',100 ); 
46 posts
  • Has been part of the Envato Community for over 3 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+2 more
MonkeeThemes
says

This is what I use:
function wpex_clean_shortcodes($content){   
    $array = array (
        '<p>[' => '[', 
        ']</p>' => ']', 
        ']<br />' => ']'
    );
    $content = strtr($content, $array);
    return $content;
}
add_filter('the_content', 'wpex_clean_shortcodes');

I have done the same thing at the end, thanks WPExplorer

46 posts
  • Has been part of the Envato Community for over 3 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+2 more
MonkeeThemes
says

and what is your Idea about this
remove_filter( 'the_content', 'wpautop' );
add_filter( 'the_content', 'wpautop' , 99);
add_filter( 'the_content', 'shortcode_unautop',100 ); 

It should not be an issue as you are putting it back but I still wouldn’t touch the wp core even though it’s cleaner… not sure it would be accepted. Post back to confirm if it is.

723 posts
  • Has been part of the Envato Community for over 3 years
  • Has sold $40,000+ on Envato Market
  • Has referred 1+ members
  • Sells items exclusively on Envato Market
+1 more
billyf
says


and what is your Idea about this
remove_filter( 'the_content', 'wpautop' );
add_filter( 'the_content', 'wpautop' , 99);
add_filter( 'the_content', 'shortcode_unautop',100 ); 
It should not be an issue as you are putting it back but I still wouldn’t touch the wp core even though it’s cleaner… not sure it would be accepted. Post back to confirm if it is.
I don’t think the reviewers would allow that. Last time my theme was soft rejected because of that code.
2468 posts
  • Has been part of the Envato Community for over 6 years
  • Has sold $100+ on Envato Market
  • Has referred 100+ members
  • Has been a beta tester for an Envato feature
+3 more
digitalimpact
says

@WPExplorer really? on your themes here? I was rejected for this twice.

Interesting to hear. Requested staff reply for this.

by
by
by
by
by
by