rest_url( string $path = , string $scheme = ‘rest’ ): string

Retrieves the URL to a REST endpoint.

Description

Note: The returned URL is NOT escaped.

Parameters

$pathstringoptional
REST route.

Default:''

$schemestringoptional
Sanitization scheme. Default 'rest'.

Default:'rest'

Return

string Full URL to the endpoint.

Source

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

Changelog

VersionDescription
4.4.0Introduced.

User Contributed Notes

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