rest_insert_{$this->post_type}

rest_insert_{$this->post_type}

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

See hook in core

Displaying hooks found in version: wordpress-6.7.2

do_action('rest_insert_{$this->post_type}') is found 2 times:

  • /wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php line 774
    770
    771
    772
    773
    774
    775
    776
    777
    778
    779
    780
    * @param WP_Post         $post     Inserted or updated post object.
     * @param WP_REST_Request $request  Request object.
     * @param bool            $creating True when creating a post, false when updating.
     */
    do_action( "rest_insert_{$this->post_type}", $post, $request, true );
     
    $schema = $this->get_item_schema();
     
    if ( ! empty( $schema['properties']['sticky'] ) ) {
        if ( ! empty( $request['sticky'] ) ) {
            stick_post( $post_id );
  • /wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php line 960
    957
    958
    959
    960
    961
    962
    963
    964
    965
    966
    $post = get_post( $post_id );
     
    /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */
    do_action( "rest_insert_{$this->post_type}", $post, $request, false );
     
    $schema = $this->get_item_schema();
     
    if ( ! empty( $schema['properties']['format'] ) && ! empty( $request['format'] ) ) {
        set_post_format( $post, $request['format'] );
    }