WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/16/2015 10:18:33 PM (4 years ago)
Author:
boonebgorges
Message:

Move new user notification emails to add_action() callbacks.

When a new user is created in various places throughout the interface,
notifications are sent to the site admin and the new user. Previously, these
notifications were fired through direct calls to wp_new_user_notification(),
making it difficult to stop or modify the messages.

This changeset introduces a number of new action hooks in place of direct calls
to wp_new_user_notification(), and hooks the new wrapper function
wp_send_new_user_notifications() to these hooks.

Props dshanske, thomaswm, boonebgorges.
Fixes #33587.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-default-filters.php

    r34112 r34251  
    2828add_action( 'wpmu_activate_user', 'wpmu_welcome_user_notification', 10, 3 );
    2929add_action( 'after_signup_user', 'wpmu_signup_user_notification', 10, 4 );
     30add_action( 'network_site_new_created_user',   'wp_send_new_user_notifications' );
     31add_action( 'network_site_users_created_user', 'wp_send_new_user_notifications' );
     32add_action( 'network_user_new_created_user',   'wp_send_new_user_notifications' );
    3033add_filter( 'sanitize_user', 'strtolower' );
    3134
Note: See TracChangeset for help on using the changeset viewer.