rest_insert_user

rest_insert_user

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action

See hook in core

Displaying hooks found in version: wordpress-6.7

do_action('rest_insert_user') is found 2 times:

  • /wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php line 631
    		 * @param WP_User         $user     Inserted or updated user object.
    		 * @param WP_REST_Request $request  Request object.
    		 * @param bool            $creating True when creating a user, false when updating.
    		 */
    		do_action( 'rest_insert_user', $user, $request, true );
    
    		if ( ! empty( $request['roles'] ) && ! empty( $schema['properties']['roles'] ) ) {
    			array_map( array( $user, 'add_role' ), $request['roles'] );
    		}
    
    		if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) {
    
  • /wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php line 786
     
    		$user = get_user_by( 'id', $user_id );
    
    		/** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php */
    		do_action( 'rest_insert_user', $user, $request, false );
    
    		if ( ! empty( $request['roles'] ) ) {
    			array_map( array( $user, 'add_role' ), $request['roles'] );
    		}
    
    		$schema = $this->get_item_schema();