nizaar saidYep, and of course you want to change the shortcodes.
@ Smuliii Thanks a lot Smuliii.. I’m not a PHP-addict, does it only need to paste the code in the end of functions.php? Or how?
nizaar saidWell it really doesn’t matter, so just put it in your functions.php file.
Dear Smuliii.. Can you explain how to solve it manually? I’ve got the fixer code at https://gist.github.com/4555047 but don’t understand where should i insert this code?Best regards,
nizaar
Yep it got approved! So thanks again! 
pixelentity saidHooray, this works!
The following is a custom filter we created to solve the same issue in our themes, feel free to use if it works for you as well: https://gist.github.com/4555047
I really can’t say what’s the difference between mine and your code (since they both modify ‘the_content‘) but if this is accepted, I’ll start using it then.
Thanks for the code!
hogash said
Hey Smulii, perhaps this could help http://themeforest.net/forums/thread/empty-p-tags-when-using-shortcodes/48520 ?
I found the original [raw] shortcode in there (which removes wpautop & wptexturize), but that’s pretty much it.
dnp_theme said
I think some jQuery could do:$(document).ready(function() { $('p:empty').remove(); });
Yeah I guess, but why I should use JS when I just could use PHP in the first place. That method would also remove all the empty paragraphs, and I certainly don’t want to do that.
MiloHoffman00 said
are you able to email us buyers or something a new download version of the theme?
No, there isn’t any way to email buyers.
webcreations907 said
Maybe there are plugins that users might install that need the p wrapping and stray p spitting that wpautop produces. What if you only apply that function of yours above to your shortcodes and leave the rest for the p tag party, then maybe TF would see it as acceptable?
The “funny” thing is that’s exactly what my code does. So if user doesn’t add [raw] shortcode to any page, the function does absolutely nothing. So what, do I now need to create a plugin and tell every buyer to install it… 
itsmattadams said
I, and others have done that in the past and they still rejected it. So I just stopped adding overly complex shortcodes in my theme. Besides, there’s plenty of plugins readily available.
Unfortunately even a few of the most simple ones sometimes “breaks” (there seems to be no logic when they work properly and when they don’t):
PHP:
function ss_framework_infobox_sc( $atts, $content = null ) {
return '<div class="infobox">' . do_shortcode( $content ) . '</div>';
}
WP editor (HTML mode):
[infobox]<h3>It’s an info box! Your title goes here.</h3>[/infobox]HTML output:
<div class="infobox"> <br /> <h3>It’s an info box! Your title goes here.</h3> <p> </p></div>
Does anyone have any alternative solutions or suggestions?
Hello everybody!
One of my WP theme got soft disabled about a month ago, and now when I finally have some time to take a look at it (and try to fix the issue), they still won’t approve it.
So, the original reason was: “Please make sure you’re not stripping out any native functionality like wpautop and wptexturize.” And that’s fine, I totally understand this.
But can you tell me why this isn’t okay, since this will affect only in user-selected area (so it won’t break any plugins).
function ss_framework_shortcode_fixer( $content ) {
$new_content = '';
$pattern_full = '{(\[raw\].*?\[/raw\])}is';
$pattern_contents = '{\[raw\](.*?)\[/raw\]}is';
$pieces = preg_split( $pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE );
$unwanted_tags = array(
'<p>[' => '[',
']</p>' => ']',
']<br />' => ']'
);
foreach ( $pieces as $piece ) {
if ( preg_match( $pattern_contents, $piece, $matches ) ) {
$new_content .= strtr( $matches[1], $unwanted_tags );
} else {
$new_content .= $piece;
}
}
return $new_content;
}
add_filter('the_content', 'ss_framework_shortcode_fixer');
The review has recommended this method, but unfortunately it doesn’t strip every empty p tag: http://www.viper007bond.com/2009/11/22/wordpress-code-earlier-shortcodes/
Nothing bad hasn’t happened to me! 
I just started a full-time job a few months ago, so obviously I don’t have as much time for support as I had before (when I was a full-time freelancer). But I will definitely reply all the questions, when I just find some time.
