rest_url( string $path = '', string $scheme = 'rest' ): string

Retrieves the URL to a REST endpoint.


Description

Note: The returned URL is NOT escaped.


Top ↑

Parameters

$path string Optional
REST route.

Default: ''

$scheme string Optional
Sanitization scheme. Default 'rest'.

Default: 'rest'


Top ↑

Return

string Full URL to the endpoint.


Top ↑

Source

File: wp-includes/rest-api.php. View all references

function rest_url( $path = '', $scheme = 'rest' ) {
	return get_rest_url( null, $path, $scheme );
}


Top ↑

Changelog

Changelog
Version Description
4.4.0 Introduced.

Top ↑

User Contributed Notes

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