rest_api_init

SummerySummery

Fires when preparing to serve an API request.

Syntax

do_action( 'rest_api_init', WP_REST_Server $wp_rest_server )

DescriptionDescription

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

ParametersParameters

$wp_rest_server

(WP_REST_Server) Server object.

SourceSource

File: wp-includes/rest-api.php

ChangelogChangelog

Changelog
Version Description
4.4.0 Introduced.
Scroll to Top