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.
定義位置
相關方法
get_rest_urlesc_urlsite_urlwp_reset_queryhome_url
引入
4.4.0
棄用
-

rest_url: 這是一個WordPress的函式,用於生成REST API端點的URL: 該函式接受一個路徑引數並返回REST API端點的完整URL。

檢索到REST端點的URL。

注意:返回的URL沒有被轉義。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function rest_url( $path = '', $scheme = 'rest' ) {
return get_rest_url( null, $path, $scheme );
}
function rest_url( $path = '', $scheme = 'rest' ) { return get_rest_url( null, $path, $scheme ); }
function rest_url( $path = '', $scheme = 'rest' ) {
	return get_rest_url( null, $path, $scheme );
}

常見問題

FAQs
檢視更多 >