Make WordPress Core

Ticket #40477: 40477.2.patch

File 40477.2.patch, 649 bytes (added by mrahmadawais, 7 years ago)

ADD: Email Notifications on user creation by WP REST API

  • src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php

    diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
    index 63fb4e9e99..900a553e22 100644
    a b class WP_REST_Users_Controller extends WP_REST_Controller { 
    510510                        if ( is_wp_error( $user_id ) ) {
    511511                                return $user_id;
    512512                        }
     513
     514                        // Trigger admin and user notifications for the new user.
     515                        wp_send_new_user_notifications( $user_id );
    513516                }
    514517
    515518                $user = get_user_by( 'id', $user_id );