Make WordPress Core

Ticket #25511: 25511.diff

File 25511.diff, 714 bytes (added by mattheu, 13 years ago)
  • wp-includes/meta.php

    diff --git a/wp-includes/meta.php b/wp-includes/meta.php
    index 4066781..56624de 100644
    a b function update_meta_cache($meta_type, $object_ids) {  
    559559
    560560        // Get meta info
    561561        $id_list = join(',', $ids);
    562         $meta_list = $wpdb->get_results( $wpdb->prepare("SELECT $column, meta_key, meta_value FROM $table WHERE $column IN ($id_list)",
     562
     563        if ( 'user_id' === $column )
     564                $orderby_col = 'umeta_id';
     565        else
     566                $orderby_col = 'meta_id';
     567       
     568        $meta_list = $wpdb->get_results( $wpdb->prepare("SELECT $column, meta_key, meta_value FROM $table WHERE $column IN ($id_list) ORDER BY $orderby_col ASC",
    563569                $meta_type), ARRAY_A );
    564570
    565571        if ( !empty($meta_list) ) {