Small fix to r14479. see #13109.

git-svn-id: https://develop.svn.wordpress.org/trunk@14480 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-05-06 18:16:39 +00:00
parent 934d7c5580
commit b6d274e817
1 changed files with 6 additions and 2 deletions

View File

@ -117,8 +117,12 @@ function get_object_taxonomies($object, $output = 'names') {
$taxonomies = array();
foreach ( (array) $wp_taxonomies as $tax_name => $tax_obj ) {
if ( array_intersect($object, (array) $tax_obj->object_type) )
$taxonomies[$tax_name] = ('names' == $output) ? $tax_name : $tax_obj;
if ( array_intersect($object, (array) $tax_obj->object_type) ) {
if ( 'names' == $output )
$taxonomies[] = $tax_name;
else
$taxonomies[ $tax_name ] = $tax_obj;
}
}
return $taxonomies;