A WordPress-centric search engine for devs and theme authors



rest_api_init ›

Since4.4.0
Deprecatedn/a
do_action( 'rest_api_init', $wp_rest_server )
Parameters:
  • (WP_REST_Server) $wp_rest_server Server object.
    Required: Yes
Defined at:
Codex:

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.





Source

do_action( 'rest_api_init', $wp_rest_server );