do_action_ref_array(). fixes #3125
git-svn-id: http://svn.automattic.com/wordpress/trunk@4186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b6ce612ffe
commit
ad1924f837
|
@ -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 == '')
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -111,9 +111,9 @@ 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) {
|
||||
|
@ -128,7 +128,35 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
$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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue