WordPress at Your Fingertips

rest_url() WP 1.0

Retrieves the URL to a REST endpoint.

Note: The returned URL is NOT escaped.

1 time — 0.0041261 sec (very slow) | 50000 times — 8.83 sec (fast)

No Hooks.

Return

String. Full URL to the endpoint.

Usage

rest_url( $path, $scheme );
$path(string)
REST route.
Default: ''
$scheme(string)
Sanitization scheme.
Default: 'rest'

Changelog

Since 4.4.0 Introduced.

Code of rest_url() WP 5.8.1

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

REST API

No comments
    Log In