- 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細)
関数リファレンス/get taxonomy
[http://wpdocs.sourceforge.jp{{localurl: テンプレート:en テンプレート:it }} 日本語] •
目次
Description
Get the object containing a taxonomy's settings (metadata).
Note that it does NOT return the list of terms associated with the taxonomy. To do this, you should use wp_list_categories()
Usage
%%%<?php get_taxonomy( $taxonomy ) ?>%%%
Parameters
- $taxonomy
- (string) (必須) The name of the taxonomy
- 初期値: なし
Return Values
- (object)
- Returns an object containing the taxonomy metadata on success.
Returns false if the taxonomy does not exist.
Examples
For example for a custom taxonomy named "features" associated with a custom post type named "rentals".
$rental_features = get_taxonomy('features'); print_r($rental_features); stdClass Object ( [hierarchical] => [update_count_callback] => [rewrite] => Array ( [slug] => features [with_front] => 1 ) [query_var] => features [public] => 1 [show_ui] => 1 [show_tagcloud] => 1 [_builtin] => [labels] => stdClass Object ( [name] => Features [singular_name] => Feature [search_items] => Search Features [popular_items] => Popular Features [all_items] => All Features [parent_item] => Parent Feature [parent_item_colon] => Parent Feature: [edit_item] => Edit Feature [update_item] => Update Feature [add_new_item] => Add New Feature [new_item_name] => New Feature Name [separate_items_with_commas] => Separate Features with commas [add_or_remove_items] => Add or remove Features [choose_from_most_used] => Choose from the most used Features ) [show_in_nav_menus] => 1 [label] => Features [singular_label] => Feature [cap] => stdClass Object ( [manage_terms] => manage_categories [edit_terms] => manage_categories [delete_terms] => manage_categories [assign_terms] => edit_posts ) [name] => features [object_type] => Array ( [0] => rentals [1] => rentals ) )
Notes
- Uses global: $wp_taxonomies (array)
Change Log
- Since: 2.3.0
Source File
get_taxonomy() is located in wp-includes/taxonomy.php
.
Related
カスタム分類: get_taxonomy(), taxonomy_exists(), register_taxonomy(), get_taxonomies(), the_taxonomies(), get_taxonomy_labels(), get_taxonomy_template(), is_object_in_taxonomy(), get_the_taxonomies(), get_post_taxonomies(), get_object_taxonomies(), is_taxonomy_hierarchical()
最新英語版: WordPress Codex » Function Reference/get taxonomy (最新版との差分)