Parse shortcodes AFTER wpautop() to avoid mangling. Have wptexturize() ignore shortcodes so quotes stay straight. fixes #6444 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@7581 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4589dad387
commit
1f101350ba
|
@ -5,7 +5,7 @@ function wptexturize($text) {
|
||||||
$next = true;
|
$next = true;
|
||||||
$output = '';
|
$output = '';
|
||||||
$curl = '';
|
$curl = '';
|
||||||
$textarr = preg_split('/(<.*>)/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
|
$textarr = preg_split('/(<.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
|
||||||
$stop = count($textarr);
|
$stop = count($textarr);
|
||||||
|
|
||||||
// if a plugin has provided an autocorrect array, use it
|
// if a plugin has provided an autocorrect array, use it
|
||||||
|
@ -26,7 +26,7 @@ function wptexturize($text) {
|
||||||
for ( $i = 0; $i < $stop; $i++ ) {
|
for ( $i = 0; $i < $stop; $i++ ) {
|
||||||
$curl = $textarr[$i];
|
$curl = $textarr[$i];
|
||||||
|
|
||||||
if (isset($curl{0}) && '<' != $curl{0} && $next) { // If it's not a tag
|
if (isset($curl{0}) && '<' != $curl{0} && '[' != $curl{0} && $next) { // If it's not a tag
|
||||||
// static strings
|
// static strings
|
||||||
$curl = str_replace($static_characters, $static_replacements, $curl);
|
$curl = str_replace($static_characters, $static_replacements, $curl);
|
||||||
// regular expressions
|
// regular expressions
|
||||||
|
|
|
@ -129,6 +129,6 @@ function shortcode_atts($pairs, $atts) {
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
add_filter( 'the_content', 'do_shortcode', 9 );
|
add_filter('the_content', 'do_shortcode', 11); // AFTER wpautop()
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue