WPDev.one

get_terms()

get_terms( mixed $args = array(), mixed $deprecated = '' )

Retrieves the terms in a given taxonomy or list of taxonomies.

Parameters 2 required

Name / Type Description
mixed

(array | string) $args Optional. Array or string of arguments. See WP_Term_Query::__construct() for information on accepted arguments. Default empty array.

Required
mixed

(array | string) $deprecated Optional. Argument array, when using the legacy function parameter format. If present, this parameter will be interpreted as `$args`, and the first function parameter will be parsed as a taxonomy or array of taxonomies. Default empty.

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 the function description for more information.

Function Information

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