Changeset 4177
- Timestamp:
- 09/08/2006 11:19:29 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/plugin.php
r4176 r4177 27 27 global $wp_filter; 28 28 29 $args = array_slice(func_get_args(), 2); 29 $args = array($string); 30 for ( $a = 2; $a < func_num_args(); $a++ ) 31 $args[] = func_get_arg($a); 30 32 31 33 merge_filters($tag); … … 38 40 foreach($functions as $function) { 39 41 40 $all_args = array_merge(array($string), $args);41 42 $function_name = $function['function']; 42 43 $accepted_args = $function['accepted_args']; 43 44 44 if ( $accepted_args == 1 ) 45 $the_args = array($string); 46 elseif ( $accepted_args > 1 ) 47 $the_args = array_slice($all_args, 0, $accepted_args); 45 if ( $accepted_args > 0 ) 46 $the_args = array_slice($args, 0, $accepted_args); 48 47 elseif ( $accepted_args == 0 ) 49 48 $the_args = NULL; 50 49 else 51 $the_args = $a ll_args;50 $the_args = $args; 52 51 53 52 $string = call_user_func_array($function_name, $the_args); … … 103 102 function do_action($tag, $arg = '') { 104 103 global $wp_filter; 105 $args = array($arg); 104 $args = array(); 105 if ( is_array($arg) && 1 == count($arg) && is_object($arg[0]) ) // array(&$this) 106 $args[] =& $arg[0]; 107 else 108 $args[] = $arg; 106 109 for ( $a = 2; $a < func_num_args(); $a++ ) 107 $args[] = func_get_arg s($a);110 $args[] = func_get_arg($a); 108 111 109 112 merge_filters($tag); … … 119 122 $accepted_args = $function['accepted_args']; 120 123 121 if ( $accepted_args == 1 ) { 122 $the_args = array($arg); 123 } elseif ( $accepted_args > 1 ) { 124 if ( $accepted_args > 0 ) 124 125 $the_args = array_slice($args, 0, $accepted_args); 125 } elseif ( $accepted_args == 0 ) {126 elseif ( $accepted_args == 0 ) 126 127 $the_args = NULL; 127 } else {128 else 128 129 $the_args = $args; 129 }130 130 131 131 $string = call_user_func_array($function_name, $the_args);
Note: See TracChangeset
for help on using the changeset viewer.