wpseek.com
WordPress开发者和主题制作者的搜索引擎



rest_prepare_{$this->post_type} › WordPress过滤钩子

Since4.7.0
已弃用n/a
apply_filters( "rest_prepare_{$this->post_type}", $response, $post, $request )
参数: (3)
  • (WP_REST_Response) $response The response object.
    Required: Yes
  • (WP_Post) $post Post object.
    Required: Yes
  • (WP_REST_Request) $request Request object.
    Required: Yes
定义在:
文档:

Filters the post data for a REST API response.

The dynamic portion of the hook name, $this->post_type, refers to the post type slug.

Possible hook names include:

  • rest_prepare_post
  • rest_prepare_page
  • rest_prepare_attachment




源码

return apply_filters( "rest_prepare_{$this->post_type}", $response, $post, $request );