2429 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Europe
  • Bought between 10 and 49 items
  • Referred between 100 and 199 users
  • Sold between 100 and 1 000 dollars
  • Microlancer Beta Tester
digitalimpact says

[...] cough bad practice…

ThemeForest approved :P

3122 posts
  • Sold between 5 000 and 10 000 dollars
  • United States
  • Bought between 10 and 49 items
  • Has been a member for 3-4 years
  • Exclusive Author
chrisakelley says


[...] cough bad practice…
ThemeForest approved :P

its more of a UX bad practice than code bad practice

also dont get me started

115 posts WordPress Wizard
  • Microlancer Beta Tester
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Most Wanted Bounty Winner
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
XiaoThemes says


[...] cough bad practice…

ThemeForest approved :P

Yeah, but this technique works fine, but it’s more a hack than a “legitime” technique, since it disable filters of WordPress.

I really liked the @OrganicBeeMedia solution, looks really easier than the filter technique.

I’ll test it here, thanks for the suggestion OrganicBeeMedia.

Cheers, Rafael Angeline

2429 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Europe
  • Bought between 10 and 49 items
  • Referred between 100 and 199 users
  • Sold between 100 and 1 000 dollars
  • Microlancer Beta Tester
digitalimpact says

Totally agree it’s not very convenient to have to wrap shortcodes with another shortcode.

@ Chris – need to work on my sarcasm.

3122 posts
  • Sold between 5 000 and 10 000 dollars
  • United States
  • Bought between 10 and 49 items
  • Has been a member for 3-4 years
  • Exclusive Author
chrisakelley says

Totally agree it’s not very convenient to have to wrap shortcodes with another shortcode. @ Chris – need to work on my sarcasm.

its to hard to project through type, maybe we can invent tone of voice typing?

2429 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Europe
  • Bought between 10 and 49 items
  • Referred between 100 and 199 users
  • Sold between 100 and 1 000 dollars
  • Microlancer Beta Tester
digitalimpact says

:D

3122 posts
  • Sold between 5 000 and 10 000 dollars
  • United States
  • Bought between 10 and 49 items
  • Has been a member for 3-4 years
  • Exclusive Author
chrisakelley says

you want to filter your shortcodes that dont need to be texturized through a filter…
add_filter( 'no_texturize_shortcodes', 'your_prefix_no_texturize' );

function your_prefix_no_texturize( $fix_stuff ) {
    $fix_stuff[] = array('make' , 'this', 'a',  'array');
    return $fix_stuff;
}

see wp-includes/formating.php line 60

ps that original code is NOT mine

NOTE : i haven’t tested this and typed it in here so there may be errors

so to get back on topic and make myself a little clearer

the array is spouse to be an array of shortcodes that you don’t want texturized, why because not all shortcodes need it removed

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
  • Microlancer Beta Tester
ChillThemes says

I use this.

function framework_remove_wpautop( $content ) {
    $content = do_shortcode( shortcode_unautop( $content ) );
    $content = preg_replace( '#^<\/p>|^<br />|<p>$#', '', $content );
    return $content;
}
</p>
3256 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Exclusive Author
  • Interviewed on the Envato Notes blog
  • Beta Tester
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
+4 more
ParkerAndKent says

Hi guys,

never interfere/remove wp core filters. Also if your code work for your theme, it can break many plugins.

Build your themes and respect WordPress!

Parker

3122 posts
  • Sold between 5 000 and 10 000 dollars
  • United States
  • Bought between 10 and 49 items
  • Has been a member for 3-4 years
  • Exclusive Author
chrisakelley says

Hi guys,

never interfere/remove wp core filters. Also if your code work for your theme, it can break many plugins.

Build your themes and respect WordPress!

Parker

Hey Parker,

if you actually read the code he’s using you’ll see thats not removing wpautop at all its moving the position its called.

actually neither are the ones Ive said are bad practice, well they kind of are but they are forcing users to wrap there shortcodes [raw][shortcde][/raw]

now the tittle of the threads misleading as hes not actually asking how to remove wpautop(as that code works) rather than wptexturize which there are filter you can run any type of tag through i.e html tags are also ran through the filters by default

no_texturize_shortcodes & no_texturize_tag located in multiple places in the core but specifically(where we’d need it) in wp-includes/formating.php in the wptexturize function ;-)

by
by
by
by
by
by