检索任何API资源的URL前缀。
原型
rest_get_url_prefix()
返回值
(string)
字首。
源文件
路径:wp-includes/rest-api.php
<?php
...
function rest_get_url_prefix() {
/**
* Filters the REST URL prefix.
*
* @since 4.4.0
*
* @param string $prefix URL prefix. Default 'wp-json'.
*/
return apply_filters( 'rest_url_prefix', 'wp-json' );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/rest_get_url_prefix/