WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
Line | Code |
---|---|
569 | /** |
570 | * Fires after a user is completely created or updated via the REST API. |
571 | * |
572 | * @since 5.0.0 |
573 | * |
574 | * @param WP_User $user Inserted or updated user object. |
575 | * @param WP_REST_Request $request Request object. |
576 | * @param bool $creating True when creating a user, false when updating. |
577 | */ |
578 | do_action( 'rest_after_insert_user', $user, $request, true ); |
579 |
|
580 | $response = $this->prepare_item_for_response( $user, $request ); |
581 | $response = rest_ensure_response( $response ); |
582 |
|
583 | $response->set_status( 201 ); |
584 | $response->header( 'Location', rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $user_id ) ) ); |
585 |
|
586 | return $response; |
587 | } |
Line | Code |
697 | $fields_update = $this->update_additional_fields_for_object( $user, $request ); |
698 |
|
699 | if ( is_wp_error( $fields_update ) ) { |
700 | return $fields_update; |
701 | } |
702 |
|
703 | $request->set_param( 'context', 'edit' ); |
704 |
|
705 | /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php */ |
706 | do_action( 'rest_after_insert_user', $user, $request, false ); |
707 |
|
708 | $response = $this->prepare_item_for_response( $user, $request ); |
709 | $response = rest_ensure_response( $response ); |
710 |
|
711 | return $response; |
712 | } |
713 |
|
714 | /** |
715 | * Checks if a given request has access to update the current user. |