17 posts
  • Has been part of the Envato Community for over 2 years
  • Has referred 10+ members
  • Located in Australia
  • Has sold $10,000+ on Envato Market
+2 more
by_heath says

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 );
414 posts Code Is Poetry
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Made it to the Authors' Hall of Fame
+8 more
gljivec says

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.

1002 posts It's in the pipeline!
  • Has sold $500,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Sells items exclusively on Envato Market
+7 more
purethemes says

I had the same problem, maybe it’s a new rule..

17 posts
  • Has been part of the Envato Community for over 2 years
  • Has referred 10+ members
  • Located in Australia
  • Has sold $10,000+ on Envato Market
+2 more
by_heath says

I had the same problem, maybe it’s a new rule..

How did you get around it?

707 posts
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+2 more
ChillThemes says

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;
}
1002 posts It's in the pipeline!
  • Has sold $500,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Sells items exclusively on Envato Market
+7 more
purethemes says


I had the same problem, maybe it’s a new rule..
How did you get around it?

Actually I didn’t need it, it was some leftover from my own “framework” and it just worked well without :D so I removed it ;)

1002 posts It's in the pipeline!
  • Has sold $500,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Sells items exclusively on Envato Market
+7 more
purethemes says

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

54 posts
  • Has collected 10+ items on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Located in Slovenia
  • Sells items exclusively on Envato Market
psvent says

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.

60 posts Talk less do more!
  • Has referred 10+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has collected 50+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+3 more
Rifki says
My item also was soft rejected for the same reason, try this:
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');
414 posts Code Is Poetry
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Made it to the Authors' Hall of Fame
+8 more
gljivec says

yes reviewer mentioned it to me that this is a part of the process now, so that themes don’t break any plugins.

by
by
by
by
by
by