Ticket #9045: 9045_shortcode.diff
File 9045_shortcode.diff, 1.5 KB (added by , 15 years ago) |
---|
-
C:/xampp/htdocs/wordpress_trunk/wp-includes/shortcodes.php
8 8 * 9 9 * [shortcode /] 10 10 * [shortcode foo="bar" baz="bing" /] 11 * [shortcode 12345 foo="bar" baz="bing" /] 11 12 * [shortcode foo="bar"]content[/shortcode] 12 13 * 13 14 * Shortcode tags support attributes and enclosed content, but does not entirely … … 199 200 * Retrieve all attributes from the shortcodes tag. 200 201 * 201 202 * The attributes list has the attribute name as the key and the value of the 202 * attribute as the value in the key/value pair. This allows for easier 203 * retrieval of the attributes, since all attributes have to be known. 203 * attribute as the value in the key/value pair. 204 * In addition, use default numeric index for unpaired attributes 205 * This allows for easier retrieval of the attributes, since all attributes have to be known. 204 206 * 205 207 * @since 2.5 206 208 * … … 224 226 elseif (isset($m[8])) 225 227 $atts[] = stripcslashes($m[8]); 226 228 } 227 } else { 228 $atts = ltrim($text); 229 } 230 231 $unpaired_attrs = preg_replace( $pattern, '', $text ); 232 $unpaired_attrs = trim( $unpaired_attrs ); 233 if ( empty($unpaired_attrs) ) 234 return $atts; 235 236 if ( preg_match_all('/(\w+)\s*/', $unpaired_attrs, $unpaired_matches, PREG_SET_ORDER) ) { 237 foreach( $unpaired_matches as $m ) 238 $atts[] = $m[1]; 229 239 } 240 230 241 return $atts; 231 242 } 232 243