函数原型
get_taxonomy( string $taxonomy ): WP_Taxonomy|false
函数描述
Retrieves the taxonomy object of $taxonomy.
是否弃用
未弃用
函数参数
-
$taxonomy
string
Required - Name of taxonomy object to return.
函数返回值
WP_Taxonomy|false The taxonomy object or false if $taxonomy doesn’t exist.
函数位置
File: wp-includes/taxonomy.php.
函数源码
function get_taxonomy( $taxonomy ) {
global $wp_taxonomies;
if ( ! taxonomy_exists( $taxonomy ) ) {
return false;
}
return $wp_taxonomies[ $taxonomy ];
}
源码链接
变更日志
| Version | Description |
|---|---|
| 2.3.0 | Introduced. |

