#3: wpmu_signup_user_notification

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:

  1. string $user The user’s login name
  2. string $user_email The user’s email
  3. string $key The activation key from wp_signup_user()
  4. 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!

One thought on “#3: wpmu_signup_user_notification

  1. Week 1 Recap: Filters 1-12 – Filters of the Day

Leave a Reply

Your email address will not be published. Required fields are marked *