May 03 2010

WordPress: undocumented “no_texturize_shortcodes” filter

Category: Articles,WordPressFractalizeR @ 7:05 pm

Modifying my WP-SynHighlight addon for WordPress I came across a problem, that WordPress rewrites symbols inside my codesyntax shortcode with their nicer Unicode equivalents. I patched code against some. Then against some more. And then some more… And at last I felt tired of patching my code. Suddenly, I came across no_texturize_shortcodes filter, documentation for which at the time of written was published nowhere.

It’s a simple filter, that is used to temporarily turn off Unicode conversion of symbols. It’s very easy to use it:

function fr_no_texturize_shortcodes($shortcodes_arr) {
 $shortcodes_arr[] = 'codesyntax';
 return $shortcodes_arr;
}
add_filter('no_texturize_shortcodes',  'fr_no_texturize_shortcodes');

So, by using this, all text inside provided shortcode tag (codesyntax) will not be converted.

Tags: ,

One Response to “WordPress: undocumented “no_texturize_shortcodes” filter”

  1. H2GD Part 28: More battles with wpautop() generating invalid HTML - herb miller says:

    […] Simon Battersby: Plugin to stop WordPress adding <br/> tags oik-plugins: bw_better_autop() WordPress undocumented “no_texturize_shortcodes” filter oik-css [bw_css] […]

Leave a Reply

You must be logged in to post a comment. Login now.