mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-16 11:35:48 +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. Built from https://develop.svn.wordpress.org/trunk@38437 git-svn-id: http://core.svn.wordpress.org/trunk@38378 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
abd9cdc07b
commit
d793020f1e
@ -2749,7 +2749,11 @@ function get_attachment_taxonomies( $attachment, $output = 'names' ) {
|
||||
}
|
||||
}
|
||||
|
||||
return array_unique($taxonomies);
|
||||
if ( 'names' === $output ) {
|
||||
$taxonomies = array_unique( $taxonomies );
|
||||
}
|
||||
|
||||
return $taxonomies;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.7-alpha-38436';
|
||||
$wp_version = '4.7-alpha-38437';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
x
Reference in New Issue
Block a user