- Most Wanted Bounty Winner
- Sold between 250 000 and 1 000 000 dollars
- Has been a member for 5-6 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Won a Competition
- Bought between 100 and 499 items
- Exclusive Author
- Referred between 200 and 499 users
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?
- Most Wanted Bounty Winner
- Sold between 250 000 and 1 000 000 dollars
- Has been a member for 5-6 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Won a Competition
- Bought between 100 and 499 items
- Exclusive Author
- Referred between 200 and 499 users

- Most Wanted Bounty Winner
- Sold between 250 000 and 1 000 000 dollars
- Has been a member for 5-6 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Won a Competition
- Bought between 100 and 499 items
- Exclusive Author
- Referred between 200 and 499 users
bump! 
I’m not sure if the reviewers would have anything against it, but does it work well for you?
- Ed
- Most Wanted Bounty Winner
- Sold between 250 000 and 1 000 000 dollars
- Has been a member for 5-6 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Won a Competition
- Bought between 100 and 499 items
- Exclusive Author
- Referred between 200 and 499 users
SwiftIdeas said
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..
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
- Most Wanted Bounty Winner
- Sold between 250 000 and 1 000 000 dollars
- Has been a member for 5-6 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Won a Competition
- Bought between 100 and 499 items
- Exclusive Author
- Referred between 200 and 499 users
SwiftIdeas said
So for every shortcode you create, you have a class on the outer wrap of “autop”?
yep .. 
My way is using jQuery :
//Clean empty p elements
$('#content p:empty').remove();
It helps a bit
