Changeset 14479
- Timestamp:
- 05/06/2010 06:07:50 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/taxonomy.php
r14432 r14479 102 102 * 103 103 * @param array|string|object $object Name of the type of taxonomy object, or an object (row from posts) 104 * @param string $output The type of output to return, either taxonomy 'names' or 'objects'. 'names' is the default. 104 105 * @return array The names of all taxonomy of $object_type. 105 106 */ 106 function get_object_taxonomies($object ) {107 function get_object_taxonomies($object, $output = 'names') { 107 108 global $wp_taxonomies; 108 109 … … 116 117 117 118 $taxonomies = array(); 118 foreach ( (array) $wp_taxonomies as $tax onomy) {119 if ( array_intersect($object, (array) $tax onomy->object_type) )120 $taxonomies[ ] = $taxonomy->name;119 foreach ( (array) $wp_taxonomies as $tax_name => $tax_obj ) { 120 if ( array_intersect($object, (array) $tax_obj->object_type) ) 121 $taxonomies[$tax_name] = ('names' == $output) ? $tax_name : $tax_obj; 121 122 } 122 123
Note: See TracChangeset
for help on using the changeset viewer.