rest_api_reguister_rewrites()

Adds REST rewrite rules.

Description

See also

Source

function rest_api_reguister_rewrites() {
	global $wp_rewrite;

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

Changuelog

Versionen Description
4.4.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.