rest_prepare_{$this->post_type}

rest_prepare_{$this->post_type}

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

See hook in core

Displaying hooks found in version: wordpress-6.8.3

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

  • /wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php line 1856
     
    		// Don't prepare the response body for HEAD requests.
    		if ( $request->is_method( 'HEAD' ) ) {
    			/** This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */
    			return apply_filters( "rest_prepare_{$this->post_type}", new WP_REST_Response( array() ), $post, $request );
    		}
    
    		$fields = $this->get_fields_for_response( $request );
    
    		// Base fields for every post.
    		$data = array();
    
  • /wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php line 2142
    		 * @param WP_REST_Response $response The response object.
    		 * @param WP_Post          $post     Post object.
    		 * @param WP_REST_Request  $request  Request object.
    		 */
    		return apply_filters( "rest_prepare_{$this->post_type}", $response, $post, $request );
    	}
    
    	/**
    	 * Overwrites the default protected and private title format.
    	 *
    	 * By default, WordPress will show password protected or private posts with a title of