wphooks.info - rest_api_init

rest_api_init

(trunk - 5.0-alpha-42177)

The hook occurs in the following file:

wp-includes/rest-api.php:
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
		/**
		 * 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