Codex tools: Log in / create account
Contents |
Retrieves the terms associated with the given object(s), in the supplied taxonomies.
The following information has to do the $args parameter and for what can be contained in the string or array of that parameter, if it exists.
The first argument is called, 'orderby' and has the default value of 'name'. The other value that is supported is 'count'.
The second argument is called, 'order' and has the default value of 'ASC'. The only other value that will be acceptable is 'DESC'.
The final argument supported is called, 'fields' and has the default value of 'all'. There are multiple other options that can be used instead. Supported values are as follows: 'all', 'ids', 'names', and finally 'all_with_object_id'.
The fields argument also decides what will be returned. If 'all' or 'all_with_object_id' is choosen or the default kept intact, then all matching terms objects will be returned. If either 'ids' or 'names' is used, then an array of all matching term ids or term names will be returned respectively.
<?php wp_get_object_terms( $object_ids, $taxonomies, $args ) ?>
Since: 2.3.0
wp_get_object_terms() is located in wp-includes/taxonomy.php.
is_term, get_term, get_term_by, get_term_children, get_terms, wp_get_object_terms