Order terms by 'name' when populating object term cache.

[34217] removed the `ORDER BY` clause from `update_object_term_cache()`, for
improved performance. But this proved to cause problems in cases where users
were expecting the results of `get_the_terms()` to be ordered by 'name'. Let's
revert the change for the time being, and look into more disciplined ordering
in a future release.

Props afercia.
See #28922. Fixes #35180.
Built from https://develop.svn.wordpress.org/trunk@36056


git-svn-id: http://core.svn.wordpress.org/trunk@36021 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Boone Gorges 2015-12-22 01:51:28 +00:00
parent 2f53c1ada2
commit e638f72a9a
2 changed files with 2 additions and 2 deletions

View File

@ -3609,7 +3609,7 @@ function update_object_term_cache($object_ids, $object_type) {
$terms = wp_get_object_terms( $ids, $taxonomies, array(
'fields' => 'all_with_object_id',
'orderby' => 'none',
'orderby' => 'name',
'update_term_meta_cache' => false,
) );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.5-alpha-36055';
$wp_version = '4.5-alpha-36056';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.