返回介绍

is_taxonomy_hierarchical()

发布于 2017-09-11 01:29:10 字数 2834 浏览 1021 评论 0 收藏 0

is_taxonomy_hierarchical( string $taxonomy )

Whether the taxonomy object is hierarchical.


description

Checks to make sure that the taxonomy is an object first. Then Gets the object, and finally returns the hierarchical value in the object.

A false return value might also mean that the taxonomy does not exist.


参数

$taxonomy

(string) (Required) Name of taxonomy object.


返回值

(bool) Whether the taxonomy is hierarchical.


源代码

File: wp-includes/taxonomy.php

function is_taxonomy_hierarchical($taxonomy) {
	if ( ! taxonomy_exists($taxonomy) )
		return false;

	$taxonomy = get_taxonomy($taxonomy);
	return $taxonomy->hierarchical;
}

更新日志

Versiondescription
2.3.0Introduced.

相关函数

Uses

  • wp-includes/taxonomy.php: taxonomy_exists()
  • wp-includes/taxonomy.php: get_taxonomy()

Used By

  • wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php: WP_REST_Terms_Controller::create_item()
  • wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php: WP_REST_Terms_Controller::update_item()
  • wp-includes/class-wp-term-query.php: WP_Term_Query::get_terms()
  • wp-admin/includes/post.php: edit_post()
  • wp-admin/includes/post.php: bulk_edit_posts()
  • wp-admin/includes/ajax-actions.php: wp_ajax_add_tag()
  • wp-admin/includes/class-wp-terms-list-table.php: WP_Terms_List_Table::display_rows_or_placeholder()
  • wp-admin/includes/nav-menu.php: wp_nav_menu_item_taxonomy_meta_box()
  • wp-includes/class-wp-tax-query.php: WP_Tax_Query::clean_query()
  • wp-includes/taxonomy.php: _pad_term_counts()
  • wp-includes/taxonomy.php: get_ancestors()
  • wp-includes/taxonomy.php: wp_unique_term_slug()
  • wp-includes/taxonomy.php: wp_insert_term()
  • wp-includes/taxonomy.php: wp_delete_term()
  • wp-includes/nav-menu-template.php: _wp_menu_item_classes_by_context()
  • wp-includes/post.php: wp_set_post_terms()
  • wp-includes/class-wp-xmlrpc-server.php: wp_xmlrpc_server::_insert_post()
  • Show 12 more used by Hide more used by

User Contributed Notes

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文