WordPress at a glance
function is not described

rest_api_register_rewrites() WP 4.4.0

Adds REST rewrite rules.

  • See: add_rewrite_rule()
  • Global. WP_Rewrite. $wp_rewrite

No Hooks.

Return

Nothing (null).

Usage

rest_api_register_rewrites();

Code of rest api register rewrites: wp-includes/rest-api.php WP 5.2.2

<?php
function rest_api_register_rewrites() {
	global $wp_rewrite;

	add_rewrite_rule( '^' . rest_get_url_prefix() . '/?$', 'index.php?rest_route=/', 'top' );
	add_rewrite_rule( '^' . rest_get_url_prefix() . '/(.*)?', 'index.php?rest_route=/$matches[1]', 'top' );
	add_rewrite_rule( '^' . $wp_rewrite->index . '/' . rest_get_url_prefix() . '/?$', 'index.php?rest_route=/', 'top' );
	add_rewrite_rule( '^' . $wp_rewrite->index . '/' . rest_get_url_prefix() . '/(.*)?', 'index.php?rest_route=/$matches[1]', 'top' );
}