Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is there a way to remove wptexturize only for a certain shortcode?

share|improve this question
1  
What is the shortcode in question? –  Chip Bennett Mar 30 '11 at 3:13
add comment

2 Answers

up vote 4 down vote accepted
+50

There is a clue in wp-includes/formatting.php in the function wptexturize:

$default_no_texturize_shortcodes = array('code');
...
$no_texturize_shortcodes = '(' . implode('|',
    apply_filters('no_texturize_shortcodes', $default_no_texturize_shortcodes) ) . ')';

Try using this filter to add a shortcode to the array:

function my_no_tex( $shortcodes ) {
    $shortcodes[] = 'someshortcode';
    return $shortcodes;
}
add_filter( 'no_texturize_shortcodes', 'my_no_tex' );
share|improve this answer
add comment

Shortcodes run after the wptexturize function, so they shouldn't get processed by it anyway.

wptexturize runs on the_content with priority 10. The do_shortcode function runs with priority 11.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.