WordPress at a glance
action is not described

rest_api_init action-hook . WP 4.4.0

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.

Usage

add_action( 'rest_api_init', 'action_function_name_8880' );
function action_function_name_8880( $wp_rest_server ){
	// action...
}
$wp_rest_server(WP_REST_Server)
Server object.

Список изменений

С версии 4.4.0 Введена.

Где вызывается хук

rest_get_server()
rest_api_init
WC_CLI_Runner::after_wp_load()
rest_api_init
wp-includes/rest-api.php 506
do_action( 'rest_api_init', $wp_rest_server );
woocommerce/includes/cli/class-wc-cli-runner.php 59
do_action( 'rest_api_init', $wp_rest_server );

Где используется хук в ядре WP

wp-includes/default-filters.php 455
add_action( 'rest_api_init', 'rest_api_default_filters', 10, 1 );
wp-includes/default-filters.php 456
add_action( 'rest_api_init', 'register_initial_settings', 10 );
wp-includes/default-filters.php 457
add_action( 'rest_api_init', 'create_initial_rest_routes', 99 );
wp-includes/default-filters.php 563
add_action( 'rest_api_init', 'wp_oembed_register_route' );