WordPress at Your Fingertips
action is not described

rest_api_init action-hook . WP 4.4.0

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.


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


Since 4.4.0 Introduced.

Where the hook is called

wp-includes/rest-api.php 521
do_action( 'rest_api_init', $wp_rest_server );

Where in WP core the hook is used WordPress

wp-includes/default-filters.php 484
add_action( 'rest_api_init', 'rest_api_default_filters', 10, 1 );
wp-includes/default-filters.php 485
add_action( 'rest_api_init', 'register_initial_settings', 10 );
wp-includes/default-filters.php 486
add_action( 'rest_api_init', 'create_initial_rest_routes', 99 );
wp-includes/default-filters.php 592
add_action( 'rest_api_init', 'wp_oembed_register_route' );