rest_get_url_prefix

函式
rest_get_url_prefix ( No parameters )
返回值
  • (string) Prefix.
定義位置
相關方法
rest_get_avatar_urlsrest_get_avatar_sizesrest_urlrest_get_servergot_url_rewrite
引入
4.4.0
棄用
-

rest_get_url_prefix: 這個函式用來檢索用於REST API請求的URL字首。它返回一個代表URL字首的字串。

檢索任何API資源的URL字首。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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' );
}
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' ); }
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' );
}

常見問題

FAQs
檢視更多 >