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/includes/user.php

    r34116 r34251  
    177177    } else {
    178178        $user_id = wp_insert_user( $user );
    179         wp_new_user_notification( $user_id, null, 'both' );
     179        /**
     180          * Fires after a new user has been created.
     181          *
     182          * @since 4.4.0
     183          *
     184          * @param int $user_id ID of the newly created user.
     185          */
     186        do_action( 'edit_user_created_user', $user_id );
    180187    }
    181188    return $user_id;
Note: See TracChangeset for help on using the changeset viewer.