Make WordPress Core

Ticket #19550: 19550.2.diff

File 19550.2.diff, 1003 bytes (added by SergeyBiryukov, 10 years ago)
  • src/wp-includes/formatting.php

     
    2929function wptexturize($text) {
    3030        global $wp_cockneyreplace;
    3131        static $static_characters, $static_replacements, $dynamic_characters, $dynamic_replacements,
    32                 $default_no_texturize_tags, $default_no_texturize_shortcodes;
     32                $default_no_texturize_tags, $default_no_texturize_shortcodes, $run_texturize = true;
    3333
     34        if ( false === $run_texturize ) {
     35                return $text;
     36        }
     37
    3438        // No need to set up these static variables more than once
    3539        if ( ! isset( $static_characters ) ) {
     40                $run_texturize = apply_filters( 'run_wptexturize', $run_texturize );
     41                if ( false === $run_texturize ) {
     42                        return $text;
     43                }
     44
    3645                /* translators: opening curly double quote */
    3746                $opening_quote = _x( '“', 'opening curly double quote' );
    3847                /* translators: closing curly double quote */