mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-05 05:04:31 +00:00
In update_meta_cache(), ensure that meta is always stored in the same order. Removes an unnecessary $wpdb->prepare statement. Adds unit test.
Props mattheu. Fixes #25511. git-svn-id: https://develop.svn.wordpress.org/trunk@26307 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -558,9 +558,9 @@ function update_meta_cache($meta_type, $object_ids) {
|
||||
return $cache;
|
||||
|
||||
// Get meta info
|
||||
$id_list = join(',', $ids);
|
||||
$meta_list = $wpdb->get_results( $wpdb->prepare("SELECT $column, meta_key, meta_value FROM $table WHERE $column IN ($id_list)",
|
||||
$meta_type), ARRAY_A );
|
||||
$id_list = join( ',', $ids );
|
||||
$id_column = 'user' == $meta_type ? 'umeta_id' : 'meta_id';
|
||||
$meta_list = $wpdb->get_results( "SELECT $column, meta_key, meta_value FROM $table WHERE $column IN ($id_list) ORDER BY $id_column ASC", ARRAY_A );
|
||||
|
||||
if ( !empty($meta_list) ) {
|
||||
foreach ( $meta_list as $metarow) {
|
||||
|
||||
Reference in New Issue
Block a user