wphooks.info - rest_api_init

rest_api_init

(trunk - 5.1-alpha-44286)

The hook occurs in the following file:

wp-includes/rest-api.php:
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
		/**
		 * 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