diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-09-13 09:27:15 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-09-13 09:27:15 +0000 |
commit | bb1e6055fe18618f9274e2d23d4b1e72b7243797 (patch) | |
tree | bd799756c88ec5bc5e5ca4c2b60db6ef49996c42 /wp-includes/plugin.php | |
parent | f41f35fc323e7aae3f8c9d7e696eb54e306cc679 (diff) | |
download | wordpress-mu-bb1e6055fe18618f9274e2d23d4b1e72b7243797.tar.gz wordpress-mu-bb1e6055fe18618f9274e2d23d4b1e72b7243797.tar.xz wordpress-mu-bb1e6055fe18618f9274e2d23d4b1e72b7243797.zip |
WP Merge to rev 4186
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@744 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/plugin.php')
-rw-r--r-- | wp-includes/plugin.php | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/wp-includes/plugin.php b/wp-includes/plugin.php index 1fe2c80..365a6f8 100644 --- a/wp-includes/plugin.php +++ b/wp-includes/plugin.php @@ -111,9 +111,37 @@ function do_action($tag, $arg = '') { merge_filters($tag); - if ( !isset($wp_filter[$tag]) ) { + if ( !isset($wp_filter[$tag]) ) return; + + foreach ($wp_filter[$tag] as $priority => $functions) { + if ( !is_null($functions) ) { + foreach($functions as $function) { + + $function_name = $function['function']; + $accepted_args = $function['accepted_args']; + + if ( $accepted_args > 0 ) + $the_args = array_slice($args, 0, $accepted_args); + elseif ( $accepted_args == 0 ) + $the_args = NULL; + else + $the_args = $args; + + call_user_func_array($function_name, $the_args); + } + } } +} + +function do_action_ref_array($tag, $args) { + global $wp_filter; + + merge_filters($tag); + + if ( !isset($wp_filter[$tag]) ) + return; + foreach ($wp_filter[$tag] as $priority => $functions) { if ( !is_null($functions) ) { foreach($functions as $function) { @@ -128,7 +156,7 @@ function do_action($tag, $arg = '') { else $the_args = $args; - $string = call_user_func_array($function_name, $the_args); + call_user_func_array($function_name, $the_args); } } } |