rest_pre_insert_{$this->post_type}

rest_pre_insert_{$this->post_type}

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('rest_pre_insert_{$this->post_type}') is found 2 times:

  • /wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php line 1465
    1461
    1462
    1463
    1464
    1465
    1466
    1467
    1468
    1469
    1470
    1471
         * @param stdClass        $prepared_post An object representing a single post prepared
         *                                       for inserting or updating the database.
         * @param WP_REST_Request $request       Request object.
         */
        return apply_filters( "rest_pre_insert_{$this->post_type}", $prepared_post, $request );
    }
     
    /**
     * Checks whether the status is valid for the given post.
     *
     * Allows for sending an update request with the current status, even if that status would not be acceptable.
  • /wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php line 656
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
            $changes->post_author = $post_author;
        }
     
        /** This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */
        return apply_filters( "rest_pre_insert_{$this->post_type}", $changes, $request );
    }
     
    /**
     * Prepare a single template output for response
     *
     * @since 5.8.0