get_taxonomies() WP 1.0
Retrieves a list of registered taxonomy names or objects.
Basis of: wp_nav_menu_taxonomy_meta_boxes()
1 time = 0.000018s = very fast | 50000 times = 0.10s = speed of light | PHP 7.0.8, WP 4.6.1
No Hooks.
Return
String[]/WP_Taxonomy[]. An array 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'
Notes
- Global. Array. $wp_taxonomies The registered taxonomies.
Changelog
Since 3.0.0 | Introduced. |
Code of get_taxonomies() get taxonomies WP 5.6
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
- edit_term_link()
- get_edit_term_link()
- get_taxonomy()
- get_term()
- get_term_by()
- get_term_children()
- get_term_field()
- get_term_link()
- get_terms()