wordpress / latest / functions / rest_url.html

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

Retrieves the URL to a REST endpoint.

Description

Note: The returned URL is NOT escaped.

Parameters

$path string Optional
REST route.

Default: ''

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

Default: 'rest'

Return

string Full URL to the endpoint.

Source

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

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

Uses

Uses Description

Used By

Used By Description

Changelog

Version Description
4.4.0 Introduced.

© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/rest_url