The wpmu_signup_user_notification
filter is used in a boolean — or true/false — capacity to determine whether a confirmation email should be sent for new user signups in Multisite. It defaults to true
.
It is evaluated in its namesake function, wpmu_signup_user_notification()
, located in wp-includes/ms-functions.php.
The filter accepts four arguments:
- string
$user
The user’s login name - string
$user_email
The user’s email - string
$key
The activation key fromwp_signup_user()
- array
$meta
By default, an empty array
If $user
is not empty, the filter returns a value of true
. Core uses the filter in just this capacity to disable sending a signup email when the ‘Skip Confirmation Email’ checkbox is selected on the Users > Add New screen.
Example:
Let’s say we only want to disable the user confirmation email for users who don’t have a Gmail address. We’ll test the user email for signs of Gmail and return false if we find it.
Have a suggested improvement? You can fork the Gist and comment back with the link. If all is agreeable, I’ll merge in your changes. Crowd-sourced documentation FTW!
Week 1 Recap: Filters 1-12 – Filters of the Day