do_action( ‘rest_api_init’, WP_REST_Server $wp_rest_server )

In this article

Fires when preparing to serve a REST API request.

Description

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

Parameters

$wp_rest_serverWP_REST_Server
Server object.

Source

do_action( 'rest_api_init', $wp_rest_server );

Changelog

VersionDescription
4.4.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.