rest_api_default_filters

Advertisement

Summery Summery

Registers the default REST API filters.

Syntax Syntax

rest_api_default_filters()

Description Description

Attached to the ‘rest_api_init’ action to make testing and disabling these filters easier.

Source Source

File: wp-includes/rest-api.php

 *
 * @see add_rewrite_rule()
 * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
 */
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' );
}

/**

Advertisement

Changelog Changelog

Changelog
Version Description
4.4.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.