mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Remove unnecessary uniqueness check in get_attachment_taxonomies().
Running the taxonomy array through `array_unique()` is unnecessary when the function returns objects, because the associative keys already ensure uniqueness. This also fixes a bug when running `get_attachment_taxonomies()` in HHVM, which doesn't like casting objects to strings for the purposes of `array_unique()`. Props swissspidy. See #37368. git-svn-id: https://develop.svn.wordpress.org/trunk@38437 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2749,7 +2749,11 @@ function get_attachment_taxonomies( $attachment, $output = 'names' ) {
|
||||
}
|
||||
}
|
||||
|
||||
return array_unique($taxonomies);
|
||||
if ( 'names' === $output ) {
|
||||
$taxonomies = array_unique( $taxonomies );
|
||||
}
|
||||
|
||||
return $taxonomies;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user