get_rest_url()
get_rest_url( int $blog_id = null, string $path = ‘/’, string $scheme = ‘rest’ )
检索站点上REST终结点的URL。
Retrieves the URL to a REST endpoint on a site.
说明(Description)
注意:返回的URL没有转义。
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$blog_id | (int) | 可选 | Blog ID,默认为空,返回当前Blog的URL。 |
$path | (string) | 可选 | 休息路线。 |
$scheme | (string) | 可选 | 卫生处理方案。 |
返回(Return)
(string)指向终结点的完整URL。
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
4.4.0 | wp-includes/rest-api.php:345 | 7 | 14 |
笔记(Notes)
例子:
get_rest_url() 为WP2原创文章,链接:https://www.wp2.cn/functions/get_rest_url/