Languages: English • Italiano • API/フィルターフック一覧/no_texturize_shortcodes 日本語 (Add your language)
The 'no_texturize_shortcodes'
filter allows you to specify which shortcodes should not be run through the wptexturize() function.
By default, WordPress will automatically texturize all post/page content, even content in shortcodes. The texturize process replaces "normal" quotes with "fancy" quotes (aka "smart" quotes, aka "curly" quotes). Sometimes this is NOT what you want... particularly if your shortcode must contain raw, preprocessed text.
This filter reveals an array of texturize-exempted shortcode names. To use the filter, simply add a new item to the array for each shortcode you want to exempt from texturization.
Do not texturize the "myshortcode" contents:
add_filter( 'no_texturize_shortcodes', 'shortcodes_to_exempt_from_wptexturize' );
function shortcodes_to_exempt_from_wptexturize( $shortcodes ) {
$shortcodes[] = 'myshortcode';
return $shortcodes;
}
Since: 2.8.0
no_texturize_shortcodes is located in wp-includes/formatting.php
.