Ticket #13109: 13109.diff
| File 13109.diff, 1.1 KB (added by , 16 years ago) |
|---|
-
wp-includes/taxonomy.php
98 98 * @uses $wp_taxonomies 99 99 * 100 100 * @param array|string|object $object Name of the type of taxonomy object, or an object (row from posts) 101 * @param string $output The type of output to return, either taxonomy 'names' or 'objects'. 'names' is the default. 101 102 * @return array The names of all taxonomy of $object_type. 102 103 */ 103 function get_object_taxonomies($object ) {104 function get_object_taxonomies($object, $output = 'names') { 104 105 global $wp_taxonomies; 105 106 106 107 if ( is_object($object) ) { … … 112 113 $object = (array) $object; 113 114 114 115 $taxonomies = array(); 115 foreach ( (array) $wp_taxonomies as $tax onomy) {116 if ( array_intersect($object, (array) $tax onomy->object_type) )117 $taxonomies[ ] = $taxonomy->name;116 foreach ( (array) $wp_taxonomies as $tax_name => $tax_obj ) { 117 if ( array_intersect($object, (array) $tax_obj->object_type) ) 118 $taxonomies[$tax_name] = ('names' == $output) ? $tax_name : $tax_obj; 118 119 } 119 120 120 121 return $taxonomies;
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)