is_taxonomy_hierarchical() - WordPress 函数参考中文文档

返回介绍

is_taxonomy_hierarchical()

发布于 2017-09-11 字数2836 浏览 963 评论 0

is_taxonomy_hierarchical( string $taxonomy )

Whether the taxonomy object is hierarchical.


描述

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;
}

更新日志

Version 描述
2.3.0 Introduced.

相关函数

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

上一篇:is_taxonomy()

下一篇:is_term()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!