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

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

  • /wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php line 774
    		 * @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
     
    		$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'] );
    		}