Make WordPress Core


Ignore:
Timestamp:
09/16/2015 10:18:33 PM (10 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-admin/network/site-users.php

    r34116 r34251  
    7878                    $update = 'err_new_dup';
    7979                } else {
    80                     wp_new_user_notification( $user_id, null, 'both' );
    8180                    add_user_to_blog( $id, $user_id, $_POST['new_role'] );
    8281                    $update = 'newuser';
     82                    /**
     83                      * Fires after a user has been created via the network site-users.php page.
     84                      *
     85                      * @since 4.4.0
     86                      *
     87                      * @param int $user_id ID of the newly created user.
     88                      */
     89                    do_action( 'network_site_users_created_user', $user_id );
    8390                }
    8491            }
Note: See TracChangeset for help on using the changeset viewer.