You appear to be a bot. Output may be restricted
Description
Replaces common plain text characters into formatted entitiesAs an example,
- 'cause today's effort makes it worth tomorrow's "holiday" …
- ’cause today’s effort makes it worth tomorrow’s “holiday” …
Usage
$string = wptexturize_after_shortcodes( $text, $reset );
Parameters
- $text
- ( string ) required – The text to be formatted
- $reset
- ( bool ) optional – Set to true for unit testing. Translated patterns will reset.
Returns
string The string replaced with html entitiesSource
File name: oik-css/includes/formatting-later.phpLines:
101 to 200 of 274
} // Apostrophe in a word. No spaces, double apostrophes, or other punctuation. if ( "'" !== $apos ) { $dynamic[ '/(?<!' . $spaces . ')\'(?!\Z|[.,:;"\'(){}[\]\-]|&[lg]t;|' . $spaces . ')/' ] = $apos; } // 9' (prime) if ( "'" !== $prime ) { $dynamic[ '/(?<=\d)\'/' ] = $prime; } // Single quotes followed by spaces or ending punctuation. if ( "'" !== $closing_single_quote ) { $dynamic[ '/\'(?=\Z|[.,)}\-\]]|>|' . $spaces . ')/' ] = $closing_single_quote; } $dynamic_characters['apos'] = array_keys( $dynamic ); $dynamic_replacements['apos'] = array_values( $dynamic ); $dynamic = array(); // Quoted Numbers like "42" if ( '"' !== $opening_quote && '"' !== $closing_quote ) { $dynamic[ '/(?<=\A|' . $spaces . ')"(\d[.,\d]*)"/' ] = $opening_quote . '$1' . $closing_quote; } // 9" (double prime) if ( '"' !== $double_prime ) { $dynamic[ '/(?<=\d)"/' ] = $double_prime; } // Double quote at start, or preceded by (, {, <, [, -, or spaces, and not followed by spaces. if ( '"' !== $opening_quote ) { $dynamic[ '/(?<=\A|[([{\-]|<|' . $spaces . ')"(?!' . $spaces . ')/' ] = $opening_quote; } // Any remaining double quotes. if ( '"' !== $closing_quote ) { $dynamic[ '/"/' ] = $closing_quote; } $dynamic_characters['quote'] = array_keys( $dynamic ); $dynamic_replacements['quote'] = array_values( $dynamic ); $dynamic = array(); // Dashes and spaces $dynamic[ '/---/' ] = $em_dash; $dynamic[ '/(?<=' . $spaces . ')--(?=' . $spaces . ')/' ] = $em_dash; $dynamic[ '/(?<!xn)--/' ] = $en_dash; $dynamic[ '/(?<=' . $spaces . ')-(?=' . $spaces . ')/' ] = $en_dash; $dynamic_characters['dash'] = array_keys( $dynamic ); $dynamic_replacements['dash'] = array_values( $dynamic ); } // Must do this every time in case plugins use these filters in a context sensitive manner /** * Filter the list of HTML elements not to texturize. * * @since 2.8.0 * * @param array $default_no_texturize_tags An array of HTML element names. */ $no_texturize_tags = apply_filters( 'no_texturize_tags', $default_no_texturize_tags ); /** * Filter the list of shortcodes not to texturize. * * @since 2.8.0 * * @param array $default_no_texturize_shortcodes An array of shortcode names. */ $no_texturize_shortcodes = apply_filters( 'no_texturize_shortcodes', $default_no_texturize_shortcodes ); $no_texturize_tags_stack = array(); $no_texturize_shortcodes_stack = array(); // Look for shortcodes and HTML elements. $tagnames = array_keys( $shortcode_tags ); $tagregexp = join( '|', array_map( 'preg_quote', $tagnames ) ); $tagregexp = "(?:$tagregexp)(?![\\w-])"; // Excerpt of get_shortcode_regex(). $comment_regex = '!' // Start of comment, after the <. . '(?:' // Unroll the loop: Consume everything until --> is found. . '-(?!->)' // Dash not followed by end of comment. . '[^\-]*+' // Consume non-dashes. . ')*+' // Loop possessively. . '(?:-->)?'; // End of comment. If not found, match all input. $shortcode_regex = '\[' // Find start of shortcode. . '[\/\[]?' // Shortcodes may begin with [/ or [[ . $tagregexp // Only match registered shortcodes, because performance. . '(?:' . '[^\[\]<>]+' // Shortcodes do not contain other shortcodes. Quantifier critical. . '|' . '<[^\[\]>]*>' // HTML elements permitted. Prevents matching ] before >. . ')*+' // Possessive critical. . '\]' // Find end of shortcode.View on GitHub View on Trac