get_taxonomies( array $args = array(), string $output = 'names', string $operator = 'and' );
This construct (function) gets all the registered taxonomies and returns them as an array of names or objects. The taxonomies are stored in the global variable
$wp_taxonomies . You specify whether you want to receive the list back with the names or the post type objects.
Keep in mind that when you call this function, it is fetching all the current registered taxonomies.
- Array of arguments to specify what you want to receive back from the request. The array will be an associative array with key => value pairs. Some of the arguments include:
_builtin– boolean. Set to
trueto include the built-in taxonomies; else, only the taxonomies are returned.
Refer to the list of arguments available when registering the taxonomy.
- (Optional) Specify if you want the taxonomy objects, i.e.
objects, returned to you. The default is
names, meaning you will receive an array of taxonomy names.
- (Optional) The operator specifies whether the arguments are all of them (
and) or any of them (
or). The default is
Returns an array (list) of taxonomy names or objects.
Your functions are bloated. Put them on a diet. Think "skinny" and "as few lines as possible."
More coming soon…keep checking back.