Description
Apply wptexturize logic in blocksThe content has been expanded and we now have output that may contain:
- a load of stuff that can be texturized,
- followed by some that can't
- `<!–notext:–>` this is the text that can't, ending in `<!–dotext:–>`
- then more that can be texturized
- Any routine that thinks it's necessary should add its own dotext: notext: pairing around stuff that can be texturized
- OR create texturized content in the first place
Usage
$string = wptexturize_blocks( $content );Parameters
- $content
- ( string ) required – the string to be texturized
Returns
string the texturized content without notext:/dotext: commentsSource
File name: oik-css/includes/formatting-later.phpLines:
1 to 22 of 22
function wptexturize_blocks( $content ) { $result = null; $rest = $content; $spos = strpos( $rest, "<!--notext:-->" ); while ( $spos != false ) { $left = substr( $rest, 0, $spos ); $result .= wptexturize_after_shortcodes( $left ); $right = substr( $rest, $spos+14 ); $epos = strpos( $right, "<!--dotext:-->" ); if ( $epos != false ) { $result .= substr( $right, 0, $epos ); $rest = substr( $right, $epos+14 ); } else { // Not expected? $result .= $right; $rest = null; } $spos = strpos( $rest, "<!--notext:-->" ); } $result .= wptexturize_after_shortcodes( $rest ); return( $result ); }View on GitHub View on Trac
Called by
Calls
1 to 1 of 1
