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



rest_api_init ›

Since4.4.0
已弃用n/a
do_action( 'rest_api_init', $wp_rest_server )
参数:
  • (WP_REST_Server) $wp_rest_server Server object.
    Required: Yes
定义在:
文档:

Fires when preparing to serve an API request.

Endpoint objects should be created and register their hooks on this action rather than another action to ensure they're only loaded when needed.





源码

do_action( 'rest_api_init', $wp_rest_server );