rest_api_init() WordPress Function

The rest_api_init() function enables the REST API for a Wordpress site. This function is typically called by the Wordpress core in the early stages of loading.

rest_api_init() #

Registers rewrite rules for the REST API.


Description

Top ↑

See also


Top ↑

Source

File: wp-includes/rest-api.php

function rest_api_init() {
	rest_api_register_rewrites();

	global $wp;
	$wp->add_query_var( 'rest_route' );
}


Top ↑

Changelog

Changelog
VersionDescription
4.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More