WordPress.org

Ready to get started?Download WordPress

Codex

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

Plugin API/Filter Reference/no texturize shortcodes

This page is marked as incomplete. You can help Codex by expanding it.

Description

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.

Parameters

$shortcodes
(array) (required) An array of shortcodes to exempt from texturizations
Default: None

Usage

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.

Examples

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;
}

Source Files

Related

Shortcode API