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

返回介绍

taxonomy_exists()

发布于 2017-09-11 字数4042 浏览 884 评论 0

taxonomy_exists( string $taxonomy )

Checks that the taxonomy name exists.


描述

Formerly is_taxonomy(), introduced in 2.3.0.


参数

$taxonomy

(string)
(Required)
Name of taxonomy object.


返回值

(bool) Whether the taxonomy exists.


源代码

File: wp-includes/taxonomy.php

function taxonomy_exists( $taxonomy ) {
	global $wp_taxonomies;

	return isset( $wp_taxonomies[$taxonomy] );
}

更新日志

Version 描述
3.0.0 Introduced.

相关函数

Used By

  • wp-includes/taxonomy.php:
    unregister_taxonomy()
  • wp-includes/class-wp-term.php:
    WP_Term::get_instance()
  • wp-includes/customize/class-wp-customize-nav-menu-item-setting.php:
    WP_Customize_Nav_Menu_Item_Setting::populate_value()
  • wp-admin/includes/class-wp-screen.php:
    WP_Screen::get()
  • wp-admin/includes/class-wp-terms-list-table.php:
    WP_Terms_List_Table::__construct()
  • wp-admin/includes/nav-menu.php:
    _wp_ajax_menu_quick_search()
  • wp-includes/category-template.php:
    wp_list_categories()
  • wp-includes/deprecated.php:
    is_taxonomy()
  • wp-includes/widgets/class-wp-widget-tag-cloud.php:
    WP_Widget_Tag_Cloud::_get_current_taxonomy()
  • wp-includes/class-wp-tax-query.php:
    WP_Tax_Query::clean_query()
  • wp-includes/taxonomy.php:
    wp_update_term()
  • wp-includes/taxonomy.php:
    wp_get_object_terms()
  • wp-includes/taxonomy.php:
    wp_insert_term()
  • wp-includes/taxonomy.php:
    wp_set_object_terms()
  • wp-includes/taxonomy.php:
    wp_remove_object_terms()
  • wp-includes/taxonomy.php:
    get_term_by()
  • wp-includes/taxonomy.php:
    get_term_children()
  • wp-includes/taxonomy.php:
    get_terms()
  • wp-includes/taxonomy.php:
    get_taxonomy()
  • wp-includes/taxonomy.php:
    is_taxonomy_hierarchical()
  • wp-includes/taxonomy.php:
    get_objects_in_term()
  • wp-includes/taxonomy.php:
    get_term()
  • wp-includes/link-template.php:
    get_adjacent_post()
  • wp-includes/link-template.php:
    get_boundary_post()
  • wp-includes/class-wp-xmlrpc-server.php:
    wp_xmlrpc_server::wp_newTerm()
  • wp-includes/class-wp-xmlrpc-server.php:
    wp_xmlrpc_server::wp_editTerm()
  • wp-includes/class-wp-xmlrpc-server.php:
    wp_xmlrpc_server::wp_deleteTerm()
  • wp-includes/class-wp-xmlrpc-server.php:
    wp_xmlrpc_server::wp_getTerm()
  • wp-includes/class-wp-xmlrpc-server.php:
    wp_xmlrpc_server::wp_getTerms()
  • wp-includes/class-wp-xmlrpc-server.php:
    wp_xmlrpc_server::wp_getTaxonomy()
  • Show 25 more used by
    Hide more used by


User Contributed Notes

  1. Skip to note content

    You must log in to vote on the helpfulness of this noteVote results for this note: 0You must log in to vote on the helpfulness of this note

    Contributed by Codex

    Basic Example

    
    $taxonomy_exist = taxonomy_exists( 'category' );
    // Returns true
    
    $taxonomy_exist = taxonomy_exists( 'post_tag' );
    // Returns true
    
    $taxonomy_exist = taxonomy_exists( 'link_category' );
    // Returns true
    
    $taxonomy_exist = taxonomy_exists( 'my_taxonomy' );
    // Returns false if global $wp_taxonomies['my_taxonomy'] is not set
    

上一篇:tag_exists()

下一篇:term_描述()

发布评论

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

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