WordPress.org

Make WordPress Core

Changeset 12750


Ignore:
Timestamp:
01/17/10 22:51:15 (4 years ago)
Author:
markjaquith
Message:

Make it obvious that do_shortcode_tag passes the tag as the third parameter. plus code spacing cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/shortcodes.php

    r12206 r12750  
    191191 * @return mixed False on failure. 
    192192 */ 
    193 function do_shortcode_tag($m) { 
     193function do_shortcode_tag( $m ) { 
    194194    global $shortcode_tags; 
    195195 
    196196    // allow [[foo]] syntax for escaping a tag 
    197     if ($m[1] == '[' && $m[6] == ']') { 
     197    if ( $m[1] == '[' && $m[6] == ']' ) { 
    198198        return substr($m[0], 1, -1); 
    199199    } 
    200200 
    201201    $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] ) ) { 
    205205        // 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]; 
    207207    } else { 
    208208        // 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]; 
    210210    } 
    211211} 
Note: See TracChangeset for help on using the changeset viewer.