get_objects_in_term


get_objects_in_term ( $term_ids, $taxonomies, $args = array() )

Parameters:
  • (int|int[]) term_ids Term ID or array of term IDs of terms that will be used.
  • (string|string[]) taxonomies String of taxonomy name or Array of string values of taxonomy names.
  • (array|string) args { Change the order of the object IDs. @type string $order Order to retrieve terms. Accepts 'ASC' or 'DESC'. Default 'ASC'. }
Returns:
  • (string[]|WP_Error) An array of object IDs as numeric strings on success, WP_Error if the taxonomy does not exist.
Defined at:

Description

Retrieves object IDs of valid taxonomy and term.The strings of `$taxonomies` must exist before this function will continue. On failure of finding a valid taxonomy, it will return a WP_Error. 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 are returned by using `$args` with either ASC or DESC array. The value should be in the key named 'order'.

Related Functions

is_object_in_term, wp_get_object_terms, get_object_term_cache, wp_set_object_terms, get_object_subtype

Top Google Results

User discussions

wpseek mobile