Wordpress: disable wptexturize globally
I have a Wordpress 开发者_开发百科page with the title "Paper 10x10". In my sidebar navigation this page is displayed as "Paper 10×10" (note that the x is texturized by Wordpress and therefor the x became a multiplication sign ×).
I have the plugin raw html plugin installed. It only disables wptexturizing for the_content
. But the navigation is not in the_content
but in get_sidebar()
.
I tried remove_filter:
remove_filter('the_content', 'wptexturize');
remove_filter('the_excerpt', 'wptexturize');
But this also only disables texturizing for the content or the excerpt.
How can I disable the wptexturize
filter globally in my Wordpress blog?
You can disable it globally with the run_wptexturize
filter, as detailed here:
add_filter( 'run_wptexturize', '__return_false' );
Try:
remove_filter('the_title', 'wptexturize');
I went to /wp-includes/default-filters.php
and looked for everything affected by wptexturize
, and did a foreach
in the same style default-filters.php
uses to add filters.
Your problem seems to have been solved, but others might eventually want the complete purge, so I'm posting it here, it being the first question to come up when searching for wptexturize
:
$filters_to_remove = array(
'comment_author', 'term_name', 'link_name', 'link_description', 'link_notes', 'bloginfo', 'wp_title', 'widget_title',
'single_post_title', 'single_cat_title', 'single_tag_title', 'single_month_title', 'nav_menu_attr_title', 'nav_menu_description',
'term_description',
'the_title', 'the_content', 'the_excerpt', 'comment_text', 'list_cats'
);
foreach ($filters_to_remove as $a_filter){
remove_filter($a_filter, 'wptexturize');
}
精彩评论