WordPress.org

Make WordPress Core

Changeset 28715


Ignore:
Timestamp:
06/10/2014 01:45:28 AM (6 years ago)
Author:
wonderboymusic
Message:

Add a $run_texturize static var to wptexturize() that is filterable via a new run-once filter: 'run_wptexturize'. Allows user to disable texturization.

Needs filter docs.

Props nacin, SergeyBiryukov.
See #19550.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r28711 r28715  
    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;
     33
     34    if ( false === $run_texturize ) {
     35        return $text;
     36    }
    3337
    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' );
Note: See TracChangeset for help on using the changeset viewer.