Ticket #3116: 3116b.diff
| File 3116b.diff, 1.0 kB (added by mdawaffe, 2 years ago) |
|---|
-
wp-includes/plugin.php
old new 102 102 103 103 function do_action($tag, $arg = '') { 104 104 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_arg($a); 110 108 111 109 merge_filters($tag); 112 110 … … 120 118 $function_name = $function['function']; 121 119 $accepted_args = $function['accepted_args']; 122 120 123 if ( $accepted_args == 1 ) { 124 if ( is_array($arg) ) 125 $the_args = $arg; 126 else 127 $the_args = array($arg); 128 } elseif ( $accepted_args > 1 ) { 121 if ( $accepted_args > 0 ) { 129 122 $the_args = array_slice($args, 0, $accepted_args); 130 123 } elseif ( $accepted_args == 0 ) { 131 124 $the_args = NULL;
