rest_url

函数


rest_url ( $path = '', $scheme = 'rest' )
参数
  • (string)
    $path
    Optional. REST route. Default empty.
    Required:
    Default: (empty)
  • (string)
    $scheme
    Optional. Sanitization scheme. Default ‘rest’.
    Required:
    Default: ‘rest’
返回值
  • (string) Full URL to the endpoint.
定义位置
  • wp-includes/rest-api.php
    , line 519
引入
4.4.0
弃用

Retrieves the URL to a REST endpoint.

Note: The returned URL is NOT escaped.

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