Changeset 4176

Show
Ignore:
Timestamp:
09/08/06 23:18:03 (2 years ago)
Author:
ryan
Message:

Specify number of accepted args.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/admin-functions.php

    r4175 r4176  
    20762076} 
    20772077 
    2078 add_action('update_option_home', 'update_home_siteurl'); 
    2079 add_action('update_option_siteurl', 'update_home_siteurl'); 
     2078add_action('update_option_home', 'update_home_siteurl', 10, 2); 
     2079add_action('update_option_siteurl', 'update_home_siteurl', 10, 2); 
    20802080 
    20812081?> 
  • trunk/wp-includes/plugin.php

    r3893 r4176  
    103103function do_action($tag, $arg = '') { 
    104104    global $wp_filter; 
    105     $extra_args = array_slice(func_get_args(), 2); 
    106     if ( is_array($arg) ) 
    107         $args = array_merge($arg, $extra_args); 
    108     else 
    109         $args = array_merge(array($arg), $extra_args); 
     105    $args = array($arg); 
     106    for ( $a = 2; $a < func_num_args(); $a++ ) 
     107        $args[] = func_get_args($a); 
    110108 
    111109    merge_filters($tag); 
     
    122120 
    123121                if ( $accepted_args == 1 ) { 
    124                     if ( is_array($arg) ) 
    125                         $the_args = $arg; 
    126                     else 
    127                         $the_args = array($arg); 
     122                    $the_args = array($arg); 
    128123                } elseif ( $accepted_args > 1 ) { 
    129124                    $the_args = array_slice($args, 0, $accepted_args);