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 | |
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
-rw-r--r-- | wp-admin/admin-functions.php | 2 | ||||
-rw-r--r-- | wp-includes/classes.php | 6 | ||||
-rw-r--r-- | wp-includes/comment.php | 2 | ||||
-rw-r--r-- | wp-includes/plugin.php | 32 | ||||
-rw-r--r-- | wp-includes/query.php | 6 | ||||
-rw-r--r-- | wp-includes/rewrite.php | 2 | ||||
-rw-r--r-- | wp-login.php | 2 |
7 files changed, 40 insertions, 12 deletions
diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 329f1f6..5b9ca47 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -475,7 +475,7 @@ function edit_user($user_id = 0) { $errors->add('user_login', __('<strong>ERROR</strong>: Please enter a username.')); /* checking the password has been typed twice */ - do_action('check_passwords', array ($user->user_login, & $pass1, & $pass2)); + do_action_ref_array('check_passwords', array ($user->user_login, & $pass1, & $pass2)); if (!$update) { if ($pass1 == '' || $pass2 == '') diff --git a/wp-includes/classes.php b/wp-includes/classes.php index 3c1db01..a23442c 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -228,7 +228,7 @@ class WP { $this->query_vars = apply_filters('request', $this->query_vars); - do_action('parse_request', array(&$this)); + do_action_ref_array('parse_request', array(&$this)); } function send_headers() { @@ -270,7 +270,7 @@ class WP { } } - do_action('send_headers', array(&$this)); + do_action_ref_array('send_headers', array(&$this)); } function build_query_string() { @@ -338,7 +338,7 @@ class WP { $this->query_posts(); $this->handle_404(); $this->register_globals(); - do_action('wp', array(&$this)); + do_action_ref_array('wp', array(&$this)); } function WP() { diff --git a/wp-includes/comment.php b/wp-includes/comment.php index 514197f..45fe0f8 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -695,7 +695,7 @@ function pingback($content, $post_ID) { endif; endforeach; - do_action('pre_ping', array(&$post_links, &$pung)); + do_action_ref_array('pre_ping', array(&$post_links, &$pung)); foreach ($post_links as $pagelinkedto){ debug_fwrite($log, "Processing -- $pagelinkedto\n"); 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); } } } diff --git a/wp-includes/query.php b/wp-includes/query.php index 925eff5..689b27f 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -350,7 +350,7 @@ class WP_Query { if ('404' == $qv['error']) {
$this->is_404 = true;
if ( !empty($query) ) {
- do_action('parse_query', array(&$this));
+ do_action_ref_array('parse_query', array(&$this));
}
return;
}
@@ -498,7 +498,7 @@ class WP_Query { }
if ( !empty($query) ) {
- do_action('parse_query', array(&$this));
+ do_action_ref_array('parse_query', array(&$this));
}
}
@@ -526,7 +526,7 @@ class WP_Query { function &get_posts() {
global $wpdb, $pagenow, $user_ID;
- do_action('pre_get_posts', array(&$this));
+ do_action_ref_array('pre_get_posts', array(&$this));
// Shorthand.
$q = &$this->query_vars;
diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php index 7865351..75445f8 100644 --- a/wp-includes/rewrite.php +++ b/wp-includes/rewrite.php @@ -735,7 +735,7 @@ class WP_Rewrite { // Put them together.
$this->rules = array_merge($robots_rewrite, $page_rewrite, $root_rewrite, $comments_rewrite, $search_rewrite, $category_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $this->extra_rules);
- do_action('generate_rewrite_rules', array(&$this));
+ do_action_ref_array('generate_rewrite_rules', array(&$this));
$this->rules = apply_filters('rewrite_rules_array', $this->rules);
return $this->rules;
diff --git a/wp-login.php b/wp-login.php index b363114..f7d3be4 100644 --- a/wp-login.php +++ b/wp-login.php @@ -188,7 +188,7 @@ default: } } - do_action('wp_authenticate', array(&$user_login, &$user_pass)); + do_action_ref_array('wp_authenticate', array(&$user_login, &$user_pass)); if ( $user_login && $user_pass ) { $user = new WP_User(0, $user_login); |