WordPress at a glance

get_taxonomies() WP 1.0

Retrieves a list of registered taxonomy names or objects.

  • Global. Array. $wp_taxonomies The registered taxonomies.
✈ 1 time = 0.000018s = very fast | 50000 times = 0.10s = speed of light PHP 7.0.8, WP 4.6.1

No Hooks.

Return

Array. A list of taxonomy names or objects.

Usage

get_taxonomies( $args, $output, $operator );
$args(array)
An array of key => value arguments to match against the taxonomy objects.
Default: empty array
$output(string)
The type of output to return in the array. Accepts either taxonomy 'names' or 'objects'.
Default: 'names'
$operator(string)
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'

Code of get_taxonomies: wp-includes/taxonomy.php VER 4.9.8

<?php
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);
}

Related Functions

From category: Any taxonomy

No comments
    Hello, !     Log In . Register