Skip to content

Commit 325769f

Browse files
fix(rest-api): Improve user creation notification filter handling
1 parent b7efb8a commit 325769f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,8 +668,8 @@ public function create_item( $request ) {
668668
* - 'false': Disable notifications entirely.
669669
* @param int $user_id User ID.
670670
*/
671-
$notify = apply_filters( 'rest_wp_user_created_notification', $notify = 'admin', $user_id );
672-
if ( $notify && 'false' !== $notify ) {
671+
$notify = apply_filters( 'rest_wp_user_created_notification', 'admin', $user_id );
672+
if ( false !== $notify ) {
673673
wp_new_user_notification( $user_id, null, $notify );
674674
}
675675

0 commit comments

Comments
 (0)