17 posts
  • Australia
  • Bought between 50 and 99 items
  • Exclusive Author
  • Has been a member for 1-2 years
  • Referred between 10 and 49 users
  • Sold between 10 000 and 50 000 dollars
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 );
405 posts Code Is Poetry
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Has been a member for 5-6 years
  • Interviewed on the Envato Notes blog
  • Author had a File in an Envato Bundle
  • Europe
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
+3 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.

988 posts It's in the pipeline!
  • Elite Author
  • Exclusive Author
  • Europe
  • Has been a member for 5-6 years
  • Bought between 100 and 499 items
  • Referred between 200 and 499 users
  • Envato Studio (Microlancer) Beta Tester
+2 more
purethemes says

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

17 posts
  • Australia
  • Bought between 50 and 99 items
  • Exclusive Author
  • Has been a member for 1-2 years
  • Referred between 10 and 49 users
  • Sold between 10 000 and 50 000 dollars
by_heath says

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

How did you get around it?

707 posts
  • Sold between 10 000 and 50 000 dollars
  • Referred between 10 and 49 users
  • Bought between 10 and 49 items
  • Has been a member for 5-6 years
  • Exclusive Author
  • Envato Studio (Microlancer) Beta Tester
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;
}
988 posts It's in the pipeline!
  • Elite Author
  • Exclusive Author
  • Europe
  • Has been a member for 5-6 years
  • Bought between 100 and 499 items
  • Referred between 200 and 499 users
  • Envato Studio (Microlancer) Beta Tester
+2 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 ;)

988 posts It's in the pipeline!
  • Elite Author
  • Exclusive Author
  • Europe
  • Has been a member for 5-6 years
  • Bought between 100 and 499 items
  • Referred between 200 and 499 users
  • Envato Studio (Microlancer) Beta Tester
+2 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 been a member for 4-5 years
  • Slovenia
  • Bought between 10 and 49 items
  • 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.

60 posts Talk less do more!
  • Elite Author
  • Exclusive Author
  • Has been a member for 2-3 years
  • Sold between 50 000 and 100 000 dollars
  • Bought between 50 and 99 items
  • Referred between 10 and 49 users
  • Indonesia
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');
405 posts Code Is Poetry
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Has been a member for 5-6 years
  • Interviewed on the Envato Notes blog
  • Author had a File in an Envato Bundle
  • Europe
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
+3 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