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

Retrieves the URL to a REST endpoint.

Description Description

Note: The returned URL is NOT escaped.

Parameters Parameters


(string) (Optional) REST route.

Default value: ''


(string) (Optional) Sanitization scheme.

Default value: 'rest'

Top ↑

Return Return

(string) Full URL to the endpoint.

Top ↑

Source Source

File: wp-includes/rest-api.php

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 User Contributed Notes

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