当サイト、Codex 日本語版は今後積極的な更新は行わない予定です。後継となる新ユーザーマニュアルは、https://ja.wordpress.org/support/ にあります。
万が一、当サイトで重大な問題を発見した際などは、フォーラムWordSlack #docs チャンネルでお知らせください。</p>

関数リファレンス/get objects in term

提供: WordPress Codex 日本語版
< 関数リファレンス
2014年7月21日 (月) 23:54時点におけるGblsm (トーク | 投稿記録)による版 (wp_parse_args() のリンク先を日本語Codexへ。)

移動先: 案内検索

このページ「関数リファレンス/get objects in term」は未翻訳です。和訳や日本語情報を加筆してくださる協力者を求めています

Description

Retrieves the object_id(s) belonging to a term in a taxonomy. Which Objects have the given term from the given taxonomy.

The strings of $taxonomies must exist before this function will continue. On failure of finding a valid taxonomy, it will return an WP_Error class, kind of like Exceptions in PHP 5, except you can't catch them. Even so, you can still test for the WP_Error class and get the error message.

The $terms aren't checked the same as $taxonomies, but still need to exist for $object_ids to be returned.

It is possible to change the order that object_ids is returned by either using PHP sort family functions or using the database by using $args with either ASC or DESC array. The value should be in the key named 'order'.

Usage

<?php get_objects_in_term( $term_ids, $taxonomies, $args ) ?>

Parameters

$term_ids
integer|array) (必須) Term id or array of term ids of terms that will be used
初期値: なし
$taxonomies
string|array) (必須) String of taxonomy name or Array of string values of taxonomy names
初期値: なし
$args
array|optional) (必須) array()
初期値: なし

Possible Arguments

order 
(string)
  • ASC - Default
  • DESC

NOTE: Arguments are passed in the format used by wp_parse_args(). e.g.

Return Values

(WP_Error|array) 
If the taxonomy does not exist, then WP_Error will be returned. On success the array can be empty meaning that there are no $object_ids found or it will return an array of the $object_ids found.

NOTE: If an object is in more than one of the terms passed to $terms, the results returned will contain duplicate object_ids

Examples

Notes

Change Log

Since: 2.3.0

Source File

get_objects_in_term() is located in /wp-includes/taxonomy.php.

Related

タームタグ: is_term(), term_exists(), get_objects_in_term(), get_term(), get_term_by(), get_term_children(), get_term_link(), get_terms(), get_the_terms(), get_the_term_list(), has_term(), sanitize_term(), the_terms(), get_object_taxonomies() is_object_in_taxonomy() the_taxonomies() wp_get_object_terms(), wp_set_object_terms(), wp_get_post_terms(), wp_set_post_terms(), wp_delete_object_term_relationships()



関数リファレンステンプレートタグ目次もご覧ください。


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