WordPress at Your Fingertips

get_taxonomies() WP 1.0

Retrieves a list of registered taxonomy names or objects.

1 time — 0.000018 sec (very fast) | 50000 times — 0.10 sec (speed of light) | PHP 7.0.8, WP 4.6.1

No Hooks.


String[]|WP_Taxonomy[]. An array of taxonomy names or objects.


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


  • Global. Array. $wp_taxonomies The registered taxonomies.


Since 3.0.0 Introduced.

Code of get_taxonomies() WP 5.8.1

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 );

Any taxonomy

No comments
    Log In