wphooks.info - rest_api_init

rest_api_init

The hook occurs in the following file:

wp-includes/rest-api.php:
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
		/**
		 * 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.
		 *
		 * @since 4.4.0
		 *
		 * @param WP_REST_Server $wp_rest_server Server object.
		 */
		do_action( 'rest_api_init', $wp_rest_server );
	}

	return $wp_rest_server;
}

/**
 * Ensures request arguments are a request object (for consistency).
 *
 * @since 4.4.0