summaryrefslogtreecommitdiffstats
path: root/wp-includes/plugin.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/plugin.php')
-rw-r--r--wp-includes/plugin.php32
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);
}
}
}