[wp-trac] [WordPress Trac] #49445: Only one argument passed to wp_login callback.
WordPress Trac
noreply at wordpress.org
Sat Feb 15 15:02:29 UTC 2020
#49445: Only one argument passed to wp_login callback.
------------------------------------+-----------------------------
Reporter: tmfhokies | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Login and Registration | Version: 5.3.2
Severity: normal | Keywords:
Focuses: |
------------------------------------+-----------------------------
Hook into the wp_login action from a barebones plugin.
{{{#!php
<?php
/**
* Plugin Name: wp_login hook issue
*/
add_action('wp_login', function ($user_login, $user) {
});
}}}
Activate the "wp_login hook issue" plugin, log out, try to log in. That
results in an "PHP Fatal error: Uncaught ArgumentCountError: Too few
arguments to function".
Even though the do_action call passes both
(https://core.trac.wordpress.org/browser/tags/5.3/src/wp-
includes/user.php#L110), the closure only receives $user_login.
Tried with PHP 7.2.22.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49445>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list