How is it, that all the popular themes being sold on themeforest; Avada, Modernize, Immersion (probably just about all of them), are able to move wpautop and wptexturize to handle column shortcodes yet we’ve been rejected for the same thing?
Message: “Please make sure you’re not stripping out any native functionality like wpautop and wptexturize.”
There’s tons on the forums about actually using this practice.
How is there such a disparity? I’m just struggling to get my head around the double standards on here. Very frustrating. Is it just luck of the draw with reviewers?
/*-----------------------------------------------------------------------------------*/
/* WP Auto Formatting Fix w/Raw shortocde
/*-----------------------------------------------------------------------------------*/
if( ! function_exists( 'wpts_content_formatter' ) ) {
function wpts_content_formatter( $content ) {
$new_content = '';
$pattern_full = '{(\[raw\].*?\[/raw\])}is';
$pattern_contents = '{\[raw\](.*?)\[/raw\]}is';
$pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE);
foreach ($pieces as $piece) {
if (preg_match($pattern_contents, $piece, $matches)) {
$new_content .= $matches[1];
} else {
$new_content .= shortcode_unautop( wptexturize( wpautop( $piece ) ) );
}
}
return $new_content;
}
}
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_content', 'wptexturize' );
remove_filter( 'the_content', 'shortcode_unautop' );
add_filter( 'the_content', 'wpts_content_formatter', 99 );
- Author had a Free File of the Month
- Sold between 250 000 and 1 000 000 dollars
- Interviewed on the Envato Notes blog
- Author had a File in an Envato Bundle
- Author was Featured
- Europe
- Bought between 10 and 49 items
- Exclusive Author
Hi,
My theme was just soft rejected for the same reason, it was never a problem in previous themes so I am wondering if this is some new rule that we should follow? If someone can clarify this I would be most grateful
.
Thanks.
- Has been a member for 4-5 years
- Item was Featured
- Author was Featured
- Bought between 100 and 499 items
- Referred between 200 and 499 users
- Exclusive Author
- Microlancer Beta Tester
- Author had a Free File of the Month
I had the same problem, maybe it’s a new rule..
purethemes said
I had the same problem, maybe it’s a new rule..
How did you get around it?
That’s bad practice… Use this:
function prefix_remove_wpautop( $content ) {
$content = do_shortcode( shortcode_unautop( $content ) );
$content = preg_replace( '#^<\/p>|^<br />|<p>$#', '', $content );
return $content;
}
</p>
OR
function prefix_remove_wpautop( $content ) {
$content = trim( wpautop( do_shortcode( $content ) ) );
if ( substr( $content, 0, 4 ) == '')
$content = substr( $content, 4 );
if ( substr( $content, -3, 3 ) == '<p>')
$content = substr( $content, 0, -3);
$content = str_replace( array( '</p><p></p>' ), '', $content );
return $content;
}
- Has been a member for 4-5 years
- Item was Featured
- Author was Featured
- Bought between 100 and 499 items
- Referred between 200 and 499 users
- Exclusive Author
- Microlancer Beta Tester
- Author had a Free File of the Month
fd_themes said
purethemes saidHow did you get around it?
I had the same problem, maybe it’s a new rule..
Actually I didn’t need it, it was some leftover from my own “framework” and it just worked well without
so I removed it 
- Has been a member for 4-5 years
- Item was Featured
- Author was Featured
- Bought between 100 and 499 items
- Referred between 200 and 499 users
- Exclusive Author
- Microlancer Beta Tester
- Author had a Free File of the Month
itsmattadams said
That’s bad practice… Use this:function prefix_remove_wpautop( $content ) { $content = do_shortcode( shortcode_unautop( $content ) ); $content = preg_replace( '#^<\/p>|^<br />|<p>$#', '', $content ); return $content; } </p>OR
function prefix_remove_wpautop( $content ) { $content = trim( wpautop( do_shortcode( $content ) ) ); if ( substr( $content, 0, 4 ) == '') $content = substr( $content, 4 ); if ( substr( $content, -3, 3 ) == '<p>') $content = substr( $content, 0, -3); $content = str_replace( array( '</p><p></p>' ), '', $content ); return $content; }
This also won’t past through review. I used 2nd solution from your code
Maybe this is a change in the review process was sparked by this thread?
Overriding core features doesn’t belong into a theme anyways. What if you break a plugin with it? If anything code like this should go into a plugin so it can easily be enabled/disabled.
function shortcode_empty_paragraph_fix($content){
$array = array (
'<p>[' => '[',
']</p>' => ']',
']<br />' => ']'
);
$content = strtr($content, $array);
return $content;
}
add_filter('the_content', 'shortcode_empty_paragraph_fix');- Author had a Free File of the Month
- Sold between 250 000 and 1 000 000 dollars
- Interviewed on the Envato Notes blog
- Author had a File in an Envato Bundle
- Author was Featured
- Europe
- Bought between 10 and 49 items
- Exclusive Author
yes reviewer mentioned it to me that this is a part of the process now, so that themes don’t break any plugins.
