Action hook 'rest_api_init'

in WP Core File wp-includes/rest-api.php at line 589

Description

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.

Occurrences

Filename Line Number
wp-includes/rest-api.php 589

Parameters

Type Name Description
WP_REST_Server $wp_rest_server Server object.

PHP Doc

/**
		 * 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.
		 *
		 * @since 4.4.0
		 *
		 * @param WP_REST_Server $wp_rest_server Server object.
		 */