[wp-trac] [WordPress Trac] #40477: REST API: Does NOT Trigger New User Notifications!
WordPress Trac
noreply at wordpress.org
Mon Dec 4 05:11:45 UTC 2017
#40477: REST API: Does NOT Trigger New User Notifications!
-------------------------------------------------+-------------------------
Reporter: mrahmadawais | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting
Component: Users | Review
Severity: normal | Version: 4.7
Keywords: dev-feedback has-patch needs- | Resolution:
testing needs-unit-tests | Focuses: rest-api
-------------------------------------------------+-------------------------
Comment (by squarecandy):
This can currently be accomplished without core modification in this way:
{{{#!php
<?php
function mynamespace_user_update($user, $request, $create)
{
$user_id = $user->ID;
wp_send_new_user_notifications($user_id);
}
add_action( 'rest_insert_user', 'mynamespace_user_update', 12, 3 );
}}}
But, yeah, a patch to make this happen by default seems like it would be
nice, especially if there's also a hook to modify it to not send the
messages.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40477#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list