wphooks.info - rest_prepare_post_type

rest_prepare_post_type

(trunk - 5.1-alpha-44286)

The hook occurs in the following file:

wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php:
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
		 * Filters a post type returned from the API.
		 *
		 * Allows modification of the post type data right before it is returned.
		 *
		 * @since 4.7.0
		 *
		 * @param WP_REST_Response $response The response object.
		 * @param object           $item     The original post type object.
		 * @param WP_REST_Request  $request  Request used to generate the response.
		 */
		return apply_filters( 'rest_prepare_post_type', $response, $post_type, $request );
	}

	/**
	 * Retrieves the post type's schema, conforming to JSON Schema.
	 *
	 * @since 4.7.0
	 *
	 * @return array Item schema data.
	 */