24 posts
  • 3 Years of Membership
  • Affiliate Level 2
  • Australia
  • Author Level 6
+3 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 );
495 posts Code Is Poetry
  • Elite Author
  • Author Level 11
  • 6 Years of Membership
  • Top Monthly Author
+10 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.

1142 posts It's in the pipeline!
  • Top Monthly Author
  • Trendsetter
  • Weekly Top Seller
  • Author Level 11
+9 more
purethemes
says

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

24 posts
  • 3 Years of Membership
  • Affiliate Level 2
  • Australia
  • Author Level 6
+3 more
by_heath
says

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

How did you get around it?

709 posts
  • Affiliate Level 2
  • Author Level 5
  • Beta Tester
  • Collector Level 2
+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;
}
1142 posts It's in the pipeline!
  • Top Monthly Author
  • Trendsetter
  • Weekly Top Seller
  • Author Level 11
+9 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 ;)

1142 posts It's in the pipeline!
  • Top Monthly Author
  • Trendsetter
  • Weekly Top Seller
  • Author Level 11
+9 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
  • Collector Level 2
  • 5 Years of Membership
  • Slovenia
  • Exclusive Author
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.

70 posts Talk less do more!
  • Weekly Top Seller
  • Affiliate Level 2
  • Author Level 7
  • Collector Level 3
+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');
495 posts Code Is Poetry
  • Elite Author
  • Author Level 11
  • 6 Years of Membership
  • Top Monthly Author
+10 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