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. git-svn-id: https://develop.svn.wordpress.org/trunk@28715 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
cfe11de507
commit
8ec05a3926
@ -29,10 +29,19 @@
|
||||
function wptexturize($text) {
|
||||
global $wp_cockneyreplace;
|
||||
static $static_characters, $static_replacements, $dynamic_characters, $dynamic_replacements,
|
||||
$default_no_texturize_tags, $default_no_texturize_shortcodes;
|
||||
$default_no_texturize_tags, $default_no_texturize_shortcodes, $run_texturize = true;
|
||||
|
||||
if ( false === $run_texturize ) {
|
||||
return $text;
|
||||
}
|
||||
|
||||
// No need to set up these static variables more than once
|
||||
if ( ! isset( $static_characters ) ) {
|
||||
$run_texturize = apply_filters( 'run_wptexturize', $run_texturize );
|
||||
if ( false === $run_texturize ) {
|
||||
return $text;
|
||||
}
|
||||
|
||||
/* translators: opening curly double quote */
|
||||
$opening_quote = _x( '“', 'opening curly double quote' );
|
||||
/* translators: closing curly double quote */
|
||||
|
Loading…
Reference in New Issue
Block a user