Make WordPress Core


Ignore:
Timestamp:
09/16/2015 10:18:33 PM (8 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/user-new.php

    r34218 r34251  
    5252            $add_user_errors = new WP_Error( 'add_user_fail', __( 'Cannot add user.' ) );
    5353        } else {
    54             wp_new_user_notification( $user_id, null, 'both' );
     54            /**
     55              * Fires after a new user has been created via the network user-new.php page.
     56              *
     57              * @since 4.4.0
     58              *
     59              * @param int $user_id ID of the newly created user.
     60              */
     61            do_action( 'network_user_new_created_user', $user_id );
    5562            wp_redirect( add_query_arg( array('update' => 'added'), 'user-new.php' ) );
    5663            exit;
Note: See TracChangeset for help on using the changeset viewer.