In wp-includes/user.php, the docs for the new_user_email_content
hook specify that both arguments are of type string
. The second argument, new_user_email
is actually an array, containing the new address as well as a hash. It is declared on line 3726 in the same file.
https://core.trac.wordpress.org/browser/tags/6.6/src/wp-includes/user.php#L3774
You're right, I completely misread the docblock. Sorry about this. I'll close the ticket. Thank you.
Hi there!
The new_user_email_content
shows second args array. See https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/user.php#L3761-L3782
/** * Filters the text of the email sent when a change of user email address is attempted. * * The following strings have a special meaning and will get replaced dynamically: * - ###USERNAME### The current user's username. * - ###ADMIN_URL### The link to click on to confirm the email change. * - ###EMAIL### The new email. * - ###SITENAME### The name of the site. * - ###SITEURL### The URL to the site. * * @since MU (3.0.0) * @since 4.9.0 This filter is no longer Multisite specific. * * @param string $email_text Text in the email. * @param array $new_user_email { * Data relating to the new user email address. * * @type string $hash The secure hash used in the confirmation link URL. * @type string $newemail The proposed new email address. * } */ $content = apply_filters( 'new_user_email_content', $email_text, $new_user_email );