Changeset 12750
- Timestamp:
- 01/17/2010 10:51:15 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/shortcodes.php
r12206 r12750 191 191 * @return mixed False on failure. 192 192 */ 193 function do_shortcode_tag( $m) {193 function do_shortcode_tag( $m ) { 194 194 global $shortcode_tags; 195 195 196 196 // allow [[foo]] syntax for escaping a tag 197 if ( $m[1] == '[' && $m[6] == ']') {197 if ( $m[1] == '[' && $m[6] == ']' ) { 198 198 return substr($m[0], 1, -1); 199 199 } 200 200 201 201 $tag = $m[2]; 202 $attr = shortcode_parse_atts( $m[3]);203 204 if ( isset( $m[5]) ) {202 $attr = shortcode_parse_atts( $m[3] ); 203 204 if ( isset( $m[5] ) ) { 205 205 // enclosing tag - extra parameter 206 return $m[1] . call_user_func( $shortcode_tags[$tag], $attr, $m[5], $m[2]) . $m[6];206 return $m[1] . call_user_func( $shortcode_tags[$tag], $attr, $m[5], $tag ) . $m[6]; 207 207 } else { 208 208 // self-closing tag 209 return $m[1] . call_user_func( $shortcode_tags[$tag], $attr, NULL, $m[2]) . $m[6];209 return $m[1] . call_user_func( $shortcode_tags[$tag], $attr, NULL, $tag ) . $m[6]; 210 210 } 211 211 }
Note: See TracChangeset
for help on using the changeset viewer.