WordPress.org

Make WordPress Core

Ticket #19550: patch-wptexturize.patch

File patch-wptexturize.patch, 959 bytes (added by toscho, 6 years ago)

Add 'do_texturize' filter

  • wp-includes/formatting.php

     
    2121 * Code within certain html blocks are skipped.
    2222 *
    2323 * @since 0.71
     24 * @uses apply_filters() Calls 'do_texturize' hook on boolean TRUE, context is raw text.
    2425 * @uses $wp_cockneyreplace Array of formatted entities for certain common phrases
    2526 *
    2627 * @param string $text The text to be formatted
    2728 * @return string The string replaced with html entities
    2829 */
    2930function wptexturize($text) {
     31        $do_texturize = apply_filters( 'do_texturize', TRUE, $text );
     32        if ( ! $do_texturize )
     33                return $text;
     34
    3035        global $wp_cockneyreplace;
    3136        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;
    3237