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:
Mark Jaquith 2008-03-31 07:56:58 +00:00
parent 4589dad387
commit 1f101350ba
2 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@ function wptexturize($text) {
$next = true;
$output = '';
$curl = '';
$textarr = preg_split('/(<.*>)/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
$textarr = preg_split('/(<.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
$stop = count($textarr);
// if a plugin has provided an autocorrect array, use it
@ -26,7 +26,7 @@ function wptexturize($text) {
for ( $i = 0; $i < $stop; $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
$curl = str_replace($static_characters, $static_replacements, $curl);
// regular expressions

View File

@ -129,6 +129,6 @@ function shortcode_atts($pairs, $atts) {
return $out;
}
add_filter( 'the_content', 'do_shortcode', 9 );
add_filter('the_content', 'do_shortcode', 11); // AFTER wpautop()
?>