WPDev.one
Core Function
View Source on Trac ↗

wp_get_object_terms()

wp_get_object_terms( mixed $object_ids, mixed $taxonomies, mixed $args = array() )

Retrieves the terms associated with the given object(s), in the supplied taxonomies.

Parameters 3 required

Name / Type Description
(int

| int[]) $object_ids The ID(s) of the object(s) to retrieve.

Required
(string

| string[]) $taxonomies The taxonomy names to retrieve terms from.

Required
(array

| string) $args See WP_Term_Query::__construct() for supported arguments.

Required

Return Value

((WP_Term[])
(WP_Term[] | int[] | string[] | string | WP_Error) Array of terms, a count thereof as a numeric string, or WP_Error if any of the taxonomies do not exist. See WP_Term_Query::get_terms() for more information.

Function Information

Since Version
2.3.0
Source File
wp-includes/taxonomy.php
Advertisement