rest_prepare_{$this->post_type}
apply_filters( “rest_prepare_{$this->post_type}”, WP_REST_Response $response , WP_Post $post , WP_REST_Request $request )
过滤器::过滤响应的post数据。
Filter Hook: Filters the post data for a response.
说明(Description)
钩子名的动态部分,$this->post_type,是指post type slug。
参数(Parameters)
参数 | 类型 | 说明 |
---|---|---|
$response | (WP_REST_Response) | 响应对象。 |
$post | (WP_Post) | Post对象。 |
$request | (WP_REST_Request) | 请求对象。 |
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
4.7.0 | wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php:1825 | 1 | 0 |
rest_prepare_{$this->post_type} 为WP2原创文章,链接:https://www.wp2.cn/hook/rest_prepare_this-post_type/