wppaste
WordPress

apply_filters( 'invited_user_email', array $new_user_email, int $user_id, array $role, string $newuser_key )

Since
5.6.0
Filters the contents of the email sent when an existing user is invited to join the site.

Compatibility

WordPress
since 5.6.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$new_user_emailarray
{ Used to build wp_mail().
@type string $to The email address of the invited user.
@type string $subject The subject of the email.
@type string $message The content of the email.
@type string $headers Headers.
}
  • $tostring

    The email address of the invited user.
  • $subjectstring

    The subject of the email.
  • $messagestring

    The content of the email.
  • $headersstring

    Headers.
$user_idint
The invited user's ID.
$rolearray
Array containing role information for the invited user.
$newuser_keystring
The key of the invitation.

Where this hook fires · 1

  • wp-admin/user-new.php:170file scope

Source code

<?php			 * }			 * @param int    $user_id     The invited user's ID.			 * @param array  $role        Array containing role information for the invited user.			 * @param string $newuser_key The key of the invitation.			 *			 */			$new_user_email = apply_filters( 'invited_user_email', $new_user_email, $user_id, $role, $newuser_key ); 			wp_mail(				$new_user_email['to'],				$new_user_email['subject'],				$new_user_email['message'],				$new_user_email['headers']

Changelog

Introduced in 5.6.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.