Make WordPress Core

Ticket #19550: 19550.diff

File 19550.diff, 1.1 KB (added by nacin, 12 years ago)

A run-once filter.

  • wp-includes/formatting.php

     
    2828 */
    2929function wptexturize($text) {
    3030        global $wp_cockneyreplace;
    31         static $opening_quote, $closing_quote, $en_dash, $em_dash, $default_no_texturize_tags, $default_no_texturize_shortcodes, $static_characters, $static_replacements, $dynamic_characters, $dynamic_replacements;
     31        static $opening_quote, $closing_quote, $en_dash, $em_dash, $default_no_texturize_tags, $default_no_texturize_shortcodes, $static_characters, $static_replacements, $dynamic_characters, $dynamic_replacements, $run_texturize = true;
    3232
     33        if ( false === $run_texturize )
     34                return $text;
     35
    3336        // No need to set up these static variables more than once
    3437        if ( empty( $opening_quote ) ) {
     38                $run_texturize = apply_filters( 'run_wptexturize', $run_texturize );
     39
    3540                /* translators: opening curly quote */
    3641                $opening_quote = _x('“', 'opening curly quote');
    3742                /* translators: closing curly quote */