Changeset 43737
- Timestamp:
- 10/17/2018 11:19:02 AM (6 years ago)
- Location:
- branches/5.0/src/wp-includes/rest-api/endpoints
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
r43691 r43737 186 186 187 187 $request->set_param( 'context', 'edit' ); 188 189 /** 190 * Fires after a single attachment is completely created or updated via the REST API. 191 * 192 * @since 5.0.0 193 * 194 * @param WP_Post $attachment 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 ); … … 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 ); -
branches/5.0/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
r43445 r43737 623 623 624 624 $context = current_user_can( 'moderate_comments' ) ? 'edit' : 'view'; 625 626 625 $request->set_param( 'context', $context ); 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 ); 627 638 628 639 $response = $this->prepare_item_for_response( $comment, $request ); … … 747 758 748 759 $request->set_param( 'context', 'edit' ); 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 ); 749 763 750 764 $response = $this->prepare_item_for_response( $comment, $request ); -
branches/5.0/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r43720 r43737 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 ); … … 726 739 727 740 $request->set_param( 'context', 'edit' ); 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 ); 728 744 729 745 $response = $this->prepare_item_for_response( $post, $request ); -
branches/5.0/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
r43714 r43737 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 $term 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 ); … … 545 558 546 559 $request->set_param( 'context', 'view' ); 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 ); 547 563 548 564 $response = $this->prepare_item_for_response( $term, $request ); -
branches/5.0/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
r43445 r43737 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 ); … … 678 689 679 690 $request->set_param( 'context', 'edit' ); 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 ); 680 694 681 695 $response = $this->prepare_item_for_response( $user, $request );
Note: See TracChangeset
for help on using the changeset viewer.