| 59 | * Get a list of registered taxonomy objects. |
| 60 | * |
| 61 | * @package WordPress |
| 62 | * @subpackage Taxonomy |
| 63 | * @since 3.0.0 |
| 64 | * @uses $wp_taxonomies |
| 65 | * @see register_taxonomy |
| 66 | * |
| 67 | * @param array $args An array of key => value arguments to match against the taxonomies. |
| 68 | * Only taxonomies having attributes that match all arguments are returned. |
| 69 | * @param string $output The type of output to return, either taxonomy 'names' or 'objects'. 'names' is the default. |
| 70 | * @return array A list of taxonomy names or objects |
| 71 | */ |
| 72 | function get_taxonomies( $args = array(), $output = 'names' ) { |
| 73 | global $wp_taxonomies; |
| 74 | |
| 75 | $taxonomies = array(); |
| 76 | foreach ( (array) $wp_taxonomies as $taxname => $taxobj ) |
| 77 | if ( empty($args) || array_intersect_assoc((array) $taxobj, $args) ) |
| 78 | $taxonomies[$taxname] = $taxobj; |
| 79 | |
| 80 | if ( 'names' == $output ) |
| 81 | return array_keys($taxonomies); |
| 82 | |
| 83 | return $taxonomies; |
| 84 | } |
| 85 | |
| 86 | /** |