WordPress.org

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Filter Reference/no texturize tags

Description

The 'no_texturize_tags' filter allows you to specify which HTML elements should not be run through the wptexturize() function.

By default, WordPress will automatically texturize all post/page content. 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.

Parameters

$default_no_texturize_tags
(array) (required) An array of HTML element names to exempt from texturization.
Default: array( 'pre', 'code', 'kbd', 'style', script', 'tt' )

Usage

This filter reveals an array of texturize-exempted HTML element names. To use the filter, add a new item to the array for each HTML element you want to exempt from texturization, or remove the elements that you do not want to exempt.

Examples

Add the blockquote HTML tag to tags exempt from texurization:

add_filter( 'no_texturize_tags', 'my_no_texturzie_tags' );
function my_no_texturzie_tags( $tags ) {
	
	$tags[] = 'blockquote';
	return Stags;
}

Change Log

Since: 2.8

Source File

no_texturize_tags is located in wp-includes/formatting.php.

Related