is_taxonomy

函式
is_taxonomy ( $taxonomy )
引數
  • (string) $taxonomy Name of taxonomy object
    Required:
返回值
  • (bool) Whether the taxonomy exists.
相關
  • taxonomy_exists()
定義位置
相關方法
register_taxonomyget_taxonomyunregister_taxonomyis_taxis_taxonomy_viewable
引入
2.3.0
棄用
3.0.0

is_taxonomy是WordPress的一個函式,它檢查給定的字串是否是一個已註冊的分類法名稱。如果給定的字串是註冊的分類法名稱,它返回一個布林值”true”,否則返回”false”。

檢查分類法名稱是否存在。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function is_taxonomy( $taxonomy ) {
_deprecated_function( __FUNCTION__, '3.0.0', 'taxonomy_exists()' );
return taxonomy_exists( $taxonomy );
}
function is_taxonomy( $taxonomy ) { _deprecated_function( __FUNCTION__, '3.0.0', 'taxonomy_exists()' ); return taxonomy_exists( $taxonomy ); }
function is_taxonomy( $taxonomy ) {
	_deprecated_function( __FUNCTION__, '3.0.0', 'taxonomy_exists()' );
	return taxonomy_exists( $taxonomy );
}

常見問題

FAQs
檢視更多 >