get_taxonomies

The timeline below displays how wordpress function get_taxonomies has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.5

/**
 * Retrieves a list of registered taxonomy names or objects.
 *
 * @since 3.0.0
 *
 * @global WP_Taxonomy[] $wp_taxonomies The registered taxonomies.
 *
 * @param array  $args     Optional. An array of `key => value` arguments to match against the taxonomy objects.
 *                         Default empty array.
 * @param string $output   Optional. The type of output to return in the array. Either 'names'
 *                         or 'objects'. Default 'names'.
 * @param string $operator Optional. The logical operation to perform. Accepts 'and' or 'or'. 'or' means only
 *                         one element from the array needs to match; 'and' means all elements must match.
 *                         Default 'and'.
 * @return string[]|WP_Taxonomy[] An array of taxonomy names or objects.
 */
function get_taxonomies($args = array(), $output = 'names', $operator = 'and')
{
    global $wp_taxonomies;
    $field = ('names' === $output) ? 'name' : false;
    return wp_filter_object_list($wp_taxonomies, $args, $operator, $field);
}

WordPress Version: 5.9

/**
 * Retrieves a list of registered taxonomy names or objects.
 *
 * @since 3.0.0
 *
 * @global WP_Taxonomy[] $wp_taxonomies The registered taxonomies.
 *
 * @param array  $args     Optional. An array of `key => value` arguments to match against the taxonomy objects.
 *                         Default empty array.
 * @param string $output   Optional. The type of output to return in the array. Accepts either taxonomy 'names'
 *                         or 'objects'. Default 'names'.
 * @param string $operator Optional. The logical operation to perform. Accepts 'and' or 'or'. 'or' means only
 *                         one element from the array needs to match; 'and' means all elements must match.
 *                         Default 'and'.
 * @return string[]|WP_Taxonomy[] An array of taxonomy names or objects.
 */
function get_taxonomies($args = array(), $output = 'names', $operator = 'and')
{
    global $wp_taxonomies;
    $field = ('names' === $output) ? 'name' : false;
    return wp_filter_object_list($wp_taxonomies, $args, $operator, $field);
}

WordPress Version: 5.3

/**
 * Retrieves a list of registered taxonomy names or objects.
 *
 * @since 3.0.0
 *
 * @global array $wp_taxonomies The registered taxonomies.
 *
 * @param array  $args     Optional. An array of `key => value` arguments to match against the taxonomy objects.
 *                         Default empty array.
 * @param string $output   Optional. The type of output to return in the array. Accepts either taxonomy 'names'
 *                         or 'objects'. Default 'names'.
 * @param string $operator Optional. The logical operation to perform. Accepts 'and' or 'or'. 'or' means only
 *                         one element from the array needs to match; 'and' means all elements must match.
 *                         Default 'and'.
 * @return string[]|WP_Taxonomy[] An array of taxonomy names or objects.
 */
function get_taxonomies($args = array(), $output = 'names', $operator = 'and')
{
    global $wp_taxonomies;
    $field = ('names' === $output) ? 'name' : false;
    return wp_filter_object_list($wp_taxonomies, $args, $operator, $field);
}

WordPress Version: 5.1

/**
 * Retrieves a list of registered taxonomy names or objects.
 *
 * @since 3.0.0
 *
 * @global array $wp_taxonomies The registered taxonomies.
 *
 * @param array  $args     Optional. An array of `key => value` arguments to match against the taxonomy objects.
 *                         Default empty array.
 * @param string $output   Optional. The type of output to return in the array. Accepts either taxonomy 'names'
 *                         or 'objects'. Default 'names'.
 * @param string $operator Optional. The logical operation to perform. Accepts 'and' or 'or'. 'or' means only
 *                         one element from the array needs to match; 'and' means all elements must match.
 *                         Default 'and'.
 * @return string[]|WP_Taxonomy[] An array of taxonomy names or objects.
 */
function get_taxonomies($args = array(), $output = 'names', $operator = 'and')
{
    global $wp_taxonomies;
    $field = ('names' == $output) ? 'name' : false;
    return wp_filter_object_list($wp_taxonomies, $args, $operator, $field);
}

WordPress Version: 4.3

/**
 * Retrieves a list of registered taxonomy names or objects.
 *
 * @since 3.0.0
 *
 * @global array $wp_taxonomies The registered taxonomies.
 *
 * @param array  $args     Optional. An array of `key => value` arguments to match against the taxonomy objects.
 *                         Default empty array.
 * @param string $output   Optional. The type of output to return in the array. Accepts either taxonomy 'names'
 *                         or 'objects'. Default 'names'.
 * @param string $operator Optional. The logical operation to perform. Accepts 'and' or 'or'. 'or' means only
 *                         one element from the array needs to match; 'and' means all elements must match.
 *                         Default 'and'.
 * @return array A list of taxonomy names or objects.
 */
function get_taxonomies($args = array(), $output = 'names', $operator = 'and')
{
    global $wp_taxonomies;
    $field = ('names' == $output) ? 'name' : false;
    return wp_filter_object_list($wp_taxonomies, $args, $operator, $field);
}

WordPress Version: 4.2

/**
 * Get a list of registered taxonomy objects.
 *
 * @since 3.0.0
 * @uses $wp_taxonomies
 *
 * @param array $args An array of key => value arguments to match against the taxonomy objects.
 * @param string $output The type of output to return, either taxonomy 'names' or 'objects'. 'names' is the default.
 * @param string $operator The logical operation to perform. 'or' means only one element
 *  from the array needs to match; 'and' means all elements must match. The default is 'and'.
 * @return array A list of taxonomy names or objects
 */
function get_taxonomies($args = array(), $output = 'names', $operator = 'and')
{
    global $wp_taxonomies;
    $field = ('names' == $output) ? 'name' : false;
    return wp_filter_object_list($wp_taxonomies, $args, $operator, $field);
}

WordPress Version: 4.1

// highest priority
/**
 * Get a list of registered taxonomy objects.
 *
 * @since 3.0.0
 * @uses $wp_taxonomies
 *
 * @param array $args An array of key => value arguments to match against the taxonomy objects.
 * @param string $output The type of output to return, either taxonomy 'names' or 'objects'. 'names' is the default.
 * @param string $operator The logical operation to perform. 'or' means only one element
 *  from the array needs to match; 'and' means all elements must match. The default is 'and'.
 * @return array A list of taxonomy names or objects
 */
function get_taxonomies($args = array(), $output = 'names', $operator = 'and')
{
    global $wp_taxonomies;
    $field = ('names' == $output) ? 'name' : false;
    return wp_filter_object_list($wp_taxonomies, $args, $operator, $field);
}

WordPress Version: 3.9

// highest priority
/**
 * Get a list of registered taxonomy objects.
 *
 * @since 3.0.0
 * @uses $wp_taxonomies
 * @see register_taxonomy
 *
 * @param array $args An array of key => value arguments to match against the taxonomy objects.
 * @param string $output The type of output to return, either taxonomy 'names' or 'objects'. 'names' is the default.
 * @param string $operator The logical operation to perform. 'or' means only one element
 *  from the array needs to match; 'and' means all elements must match. The default is 'and'.
 * @return array A list of taxonomy names or objects
 */
function get_taxonomies($args = array(), $output = 'names', $operator = 'and')
{
    global $wp_taxonomies;
    $field = ('names' == $output) ? 'name' : false;
    return wp_filter_object_list($wp_taxonomies, $args, $operator, $field);
}

WordPress Version: 3.7

// highest priority
/**
 * Get a list of registered taxonomy objects.
 *
 * @package WordPress
 * @subpackage Taxonomy
 * @since 3.0.0
 * @uses $wp_taxonomies
 * @see register_taxonomy
 *
 * @param array $args An array of key => value arguments to match against the taxonomy objects.
 * @param string $output The type of output to return, either taxonomy 'names' or 'objects'. 'names' is the default.
 * @param string $operator The logical operation to perform. 'or' means only one element
 *  from the array needs to match; 'and' means all elements must match. The default is 'and'.
 * @return array A list of taxonomy names or objects
 */
function get_taxonomies($args = array(), $output = 'names', $operator = 'and')
{
    global $wp_taxonomies;
    $field = ('names' == $output) ? 'name' : false;
    return wp_filter_object_list($wp_taxonomies, $args, $operator, $field);
}