• 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細

このWikiはいつでも誰でも編集できます

「関数リファレンス/get tags」の版間の差分

提供: WordPress Codex 日本語版
移動先: 案内検索
(en:Function Reference/get tags 22:09, 30 June 2009 Ramiy)
(相違点なし)

2010年4月25日 (日) 03:28時点における版

Taken and slightly altered from the notes in the taxonomy.php file for get_terms, on which this function relies:

Retrieves a list of post tags based on the criteria provided in $args. The list of arguments that $args can contain, which will overwrite the defaults:

orderby - Default is 'name'. Can be name, count, or nothing (will use term_id).

order - Default is ASC. Can use DESC.

hide_empty - Default is true. Will not return empty terms, which means terms whose count is 0 according to the given taxonomy.

exclude - Default is an empty string. A comma- or space-delimited string of term ids to exclude from the return array. If 'include' is non-empty, 'exclude' is ignored.

include - Default is an empty string. A comma- or space-delimited string of term ids to include in the return array.

number - The maximum number of terms to return. Default is empty.

offset - The number by which to offset the terms query.

fields - Default is 'all', which returns an array of term objects. If 'fields' is 'ids' or 'names', returns an array of integers or strings, respectively.

slug - Returns terms whose "slug" matches this value. Default is empty string.

hierarchical - Whether to include terms that have non-empty descendants (even if 'hide_empty' is set to true).

search - Returned terms' names will contain the value of 'search', case-insensitive. Default is an empty string.

name__like - Returned terms' names will begin with the value of 'name__like', case-insensitive. Default is empty string.

The argument 'pad_counts', if set to true will include the quantity of a term's children in the quantity of each term's "count" object variable.

The 'get' argument, if set to 'all' instead of its default empty string, returns terms regardless of ancestry or whether the terms are empty.

The 'child_of' argument, when used, should be set to the integer of a term ID. Its default is 0. If set to a non-zero value, all returned terms will be descendants of that term according to the given taxonomy. Hence 'child_of' is set to 0 if more than one taxonomy is passed in $taxonomies, because multiple taxonomies make term ancestry ambiguous.

The 'parent' argument, when used, should be set to the integer of a term ID. Its default is the empty string, which has a different meaning from the integer 0. If set to an integer value, all returned terms will have as an immediate ancestor the term whose ID is specified by that integer according to the given taxonomy. The 'parent' argument is different from 'child_of' in that a term X is considered a 'parent' of term Y only if term X is the father of term Y, not its grandfather or great-grandfather, etc.

Related

タグ: get_tag(), get_tag_link(), get_tags(), get_the_tag_list(), get_the_tags(), is_tag(), the_tags(), single_tag_title(), tag_description(), wp_generate_tag_cloud(), wp_tag_cloud()


テンプレートタグへの PHP 関数型パラメータの渡し方関数リファレンステンプレートタグ目次もご覧ください。

最新英語版: WordPress Codex » Function Reference/get tags最新版との差分