Changeset 14108 for trunk/wp-includes/taxonomy.php
- Timestamp:
- 04/16/2010 02:08:58 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/taxonomy.php
r14077 r14108 68 68 * @see register_taxonomy 69 69 * 70 * @param array $args An array of key => value arguments to match against the taxonomies. 71 * Only taxonomies having attributes that match all arguments are returned. 70 * @param array $args An array of key => value arguments to match against the taxonomy objects. 72 71 * @param string $output The type of output to return, either taxonomy 'names' or 'objects'. 'names' is the default. 72 * @param string $operator The logical operation to perform. 'or' means only one element 73 * from the array needs to match; 'and' means all elements must match. The default is 'and'. 73 74 * @return array A list of taxonomy names or objects 74 75 */ 75 function get_taxonomies( $args = array(), $output = 'names' ) {76 function get_taxonomies( $args = array(), $output = 'names', $operator = 'and' ) { 76 77 global $wp_taxonomies; 77 78 78 $taxonomies = array(); 79 foreach ( (array) $wp_taxonomies as $taxname => $taxobj ) 80 if ( empty($args) || array_intersect_assoc((array) $taxobj, $args) ) 81 $taxonomies[$taxname] = $taxobj; 82 83 if ( 'names' == $output ) 84 return array_keys($taxonomies); 85 86 return $taxonomies; 87 } 79 $field = ('names' == $output) ? 'name' : false; 80 81 return wp_filter_object_list($wp_taxonomies, $args, $operator, $field); 82 } 83 88 84 89 85 /**
Note: See TracChangeset
for help on using the changeset viewer.