RSS und Atom Feed Reader Online

WordPress Trac: Ticket #61944: Wrong argument type in documentation for hook new_user_email_content

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

milestone deleted

  • milestone Awaiting Review deleted
Veröffentlicht am 28.08.2024 um 09:20:13 Uhr - Kategorie: Ticket - Autor: mukesh27

status changed; resolution set

  • status changed from new to closed
  • resolution set to invalid

You're right, I completely misread the docblock. Sorry about this. I'll close the ticket. Thank you.

Veröffentlicht am 28.08.2024 um 08:48:30 Uhr - Kategorie: Ticket - Autor: roytanck

keywords set

  • keywords reporter-feedback added

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 );
Veröffentlicht am 28.08.2024 um 08:46:02 Uhr - Kategorie: Ticket - Autor: mukesh27



Webhosting bei Alfahosting - jetzt kostenlos testen!