diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
index 671afa6f4b..eb84a64c6b 100644
a
|
b
|
class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { |
185 | 185 | } |
186 | 186 | |
187 | 187 | $request->set_param( 'context', 'edit' ); |
| 188 | |
| 189 | /** |
| 190 | * Fires after a single post is completely created or updated via the REST API. |
| 191 | * |
| 192 | * @since 5.0.0 |
| 193 | * |
| 194 | * @param WP_Post $post Inserted or updated attachment object. |
| 195 | * @param WP_REST_Request $request Request object. |
| 196 | * @param bool $creating True when creating an attachment, false when updating. |
| 197 | */ |
| 198 | do_action( 'rest_after_insert_attachment', $attachment, $request, true ); |
| 199 | |
188 | 200 | $response = $this->prepare_item_for_response( $attachment, $request ); |
189 | 201 | $response = rest_ensure_response( $response ); |
190 | 202 | $response->set_status( 201 ); |
… |
… |
class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { |
231 | 243 | } |
232 | 244 | |
233 | 245 | $request->set_param( 'context', 'edit' ); |
| 246 | |
| 247 | /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php */ |
| 248 | do_action( 'rest_after_insert_attachment', $attachment, $request, false ); |
| 249 | |
234 | 250 | $response = $this->prepare_item_for_response( $attachment, $request ); |
235 | 251 | $response = rest_ensure_response( $response ); |
236 | 252 | |
diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
index 6ce995dc29..20e20fb64e 100644
a
|
b
|
class WP_REST_Comments_Controller extends WP_REST_Controller { |
622 | 622 | } |
623 | 623 | |
624 | 624 | $context = current_user_can( 'moderate_comments' ) ? 'edit' : 'view'; |
625 | | |
626 | 625 | $request->set_param( 'context', $context ); |
627 | 626 | |
| 627 | /** |
| 628 | * Fires completely after a comment is created or updated via the REST API. |
| 629 | * |
| 630 | * @since 5.0.0 |
| 631 | * |
| 632 | * @param WP_Comment $comment Inserted or updated comment object. |
| 633 | * @param WP_REST_Request $request Request object. |
| 634 | * @param bool $creating True when creating a comment, false |
| 635 | * when updating. |
| 636 | */ |
| 637 | do_action( 'rest_after_insert_comment', $comment, $request, true ); |
| 638 | |
628 | 639 | $response = $this->prepare_item_for_response( $comment, $request ); |
629 | 640 | $response = rest_ensure_response( $response ); |
630 | 641 | |
… |
… |
class WP_REST_Comments_Controller extends WP_REST_Controller { |
747 | 758 | |
748 | 759 | $request->set_param( 'context', 'edit' ); |
749 | 760 | |
| 761 | /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php */ |
| 762 | do_action( 'rest_after_insert_comment', $comment, $request, false ); |
| 763 | |
750 | 764 | $response = $this->prepare_item_for_response( $comment, $request ); |
751 | 765 | |
752 | 766 | return rest_ensure_response( $response ); |
diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
index 3465271a11..3fbf169b76 100644
a
|
b
|
class WP_REST_Posts_Controller extends WP_REST_Controller { |
600 | 600 | |
601 | 601 | $request->set_param( 'context', 'edit' ); |
602 | 602 | |
| 603 | /** |
| 604 | * Fires after a single post is completely created or updated via the REST API. |
| 605 | * |
| 606 | * The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug. |
| 607 | * |
| 608 | * @since 5.0.0 |
| 609 | * |
| 610 | * @param WP_Post $post Inserted or updated post object. |
| 611 | * @param WP_REST_Request $request Request object. |
| 612 | * @param bool $creating True when creating a post, false when updating. |
| 613 | */ |
| 614 | do_action( "rest_after_insert_{$this->post_type}", $post, $request, true ); |
| 615 | |
603 | 616 | $response = $this->prepare_item_for_response( $post, $request ); |
604 | 617 | $response = rest_ensure_response( $response ); |
605 | 618 | |
… |
… |
class WP_REST_Posts_Controller extends WP_REST_Controller { |
726 | 739 | |
727 | 740 | $request->set_param( 'context', 'edit' ); |
728 | 741 | |
| 742 | /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */ |
| 743 | do_action( "rest_after_insert_{$this->post_type}", $post, $request, false ); |
| 744 | |
729 | 745 | $response = $this->prepare_item_for_response( $post, $request ); |
730 | 746 | |
731 | 747 | return rest_ensure_response( $response ); |
diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
index 2ff122eeb8..e1757ac3b9 100644
a
|
b
|
class WP_REST_Terms_Controller extends WP_REST_Controller { |
456 | 456 | |
457 | 457 | $request->set_param( 'context', 'view' ); |
458 | 458 | |
| 459 | /** |
| 460 | * Fires after a single term is completely created or updated via the REST API. |
| 461 | * |
| 462 | * The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug. |
| 463 | * |
| 464 | * @since 5.0.0 |
| 465 | * |
| 466 | * @param WP_Term $post Inserted or updated term object. |
| 467 | * @param WP_REST_Request $request Request object. |
| 468 | * @param bool $creating True when creating a term, false when updating. |
| 469 | */ |
| 470 | do_action( "rest_after_insert_{$this->taxonomy}", $term, $request, true ); |
| 471 | |
459 | 472 | $response = $this->prepare_item_for_response( $term, $request ); |
460 | 473 | $response = rest_ensure_response( $response ); |
461 | 474 | |
… |
… |
class WP_REST_Terms_Controller extends WP_REST_Controller { |
545 | 558 | |
546 | 559 | $request->set_param( 'context', 'view' ); |
547 | 560 | |
| 561 | /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php */ |
| 562 | do_action( "rest_after_insert_{$this->taxonomy}", $term, $request, false ); |
| 563 | |
548 | 564 | $response = $this->prepare_item_for_response( $term, $request ); |
549 | 565 | |
550 | 566 | return rest_ensure_response( $response ); |
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 b5c2071cd8..cfccfbd3b9 100644
a
|
b
|
class WP_REST_Users_Controller extends WP_REST_Controller { |
555 | 555 | |
556 | 556 | $request->set_param( 'context', 'edit' ); |
557 | 557 | |
| 558 | /** |
| 559 | * Fires after a user is completely created or updated via the REST API. |
| 560 | * |
| 561 | * @since 5.0.0 |
| 562 | * |
| 563 | * @param WP_User $user Inserted or updated user object. |
| 564 | * @param WP_REST_Request $request Request object. |
| 565 | * @param bool $creating True when creating a user, false when updating. |
| 566 | */ |
| 567 | do_action( 'rest_after_insert_user', $user, $request, true ); |
| 568 | |
558 | 569 | $response = $this->prepare_item_for_response( $user, $request ); |
559 | 570 | $response = rest_ensure_response( $response ); |
560 | 571 | |
… |
… |
class WP_REST_Users_Controller extends WP_REST_Controller { |
678 | 689 | |
679 | 690 | $request->set_param( 'context', 'edit' ); |
680 | 691 | |
| 692 | /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php */ |
| 693 | do_action( 'rest_after_insert_user', $user, $request, false ); |
| 694 | |
681 | 695 | $response = $this->prepare_item_for_response( $user, $request ); |
682 | 696 | $response = rest_ensure_response( $response ); |
683 | 697 | |