Fires when preparing to serve a REST 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.
$wp_rest_serverWP_REST_Server
do_action( 'rest_api_init', $wp_rest_server );
| Version | Description |
|---|---|
| 4.4.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/rest_api_init