do_action
-
I need help trying to understand how do_action works. I am trying to modify the login function of WordPress. I’m looking for the do_action(‘wp_authenicate’, array(&user_login &user_pass));
But I can’t find a reference to it anywhere. I know it has something to do with filters, but I can’t locate in the code where authentication happens. Please help.
Code of do_action
function do_action($tag, $arg = ”) {
global $wp_filter;
$extra_args = array_slice(func_get_args(), 2);
if ( is_array($arg) )
$args = array_merge($arg, $extra_args);
else
$args = array_merge(array($arg), $extra_args);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 == 1 ) {
if ( is_array($arg) )
$the_args = $arg;
else
$the_args = array($arg);
} elseif ( $accepted_args > 1 ) {
$the_args = array_slice($args, 0, $accepted_args);
} elseif ( $accepted_args == 0 ) {
$the_args = NULL;
} else {
$the_args = $args;
}
$string = call_user_func_array($function_name, $the_args);
}
}
}
}
- The topic ‘do_action’ is closed to new replies.