WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#3125 closed defect (bug) (fixed)

do_action no longer handling array() arguments

Reported by: dwc Owned by: ryan
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

A recent change to do_action (some combination of [4176] and [4177]?) seems to have broken the few actions which pass an array containing more than one argument:

./wp-admin/admin-functions.php:478:     do_action('check_passwords', array ($user->user_login, & $pass1, & $pass2));
./wp-includes/comment.php:698:  do_action('pre_ping',  array(&$post_links, &$pung));
./wp-login.php:191:     do_action('wp_authenticate', array(&$user_login, &$user_pass));

Previously do_action would "unwrap" these arguments and pass them to plugin functions. Now, plugins get the array itself, causing errors like:

Missing argument 2 for authenticate()

This occurs regardless of how many arguments the plugin claims to accept in its add_action() call.

Change History (3)

comment:1 ryan8 years ago

  • Owner changed from anonymous to ryan

comment:2 ryan8 years ago

We're trying to rationalize when arrays are exploded into separate args. Introducing do_action_ref_array() for supporting those instances where we want to explode an array in order to do call time pass by reference.

comment:3 ryan8 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [4186]) do_action_ref_array(). fixes #3125

Note: See TracTickets for help on using tickets.