Summery Summery

Retrieves the URL to a REST endpoint.

Syntax Syntax

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

Description Description

Note: The returned URL is NOT escaped.

Parameters Parameters


(string) (Optional) REST route.

Default value: ''


(string) (Optional) Sanitization scheme.

Default value: 'rest'

Return Return

(string) Full URL to the endpoint.

Source Source

File: wp-includes/rest-api.php

		 * In this situation the home URL may be http:, and `is_ssl()` may be false,
		 * but the admin is served over https: (one way or another), so REST API usage
		 * will be blocked by browsers unless it is also served over HTTPS.


Changelog Changelog

Version Description
4.4.0 Introduced.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.