WordPress.org

Make WordPress Core

Changeset 18602


Ignore:
Timestamp:
08/25/11 18:22:17 (5 years ago)
Author:
ryan
Message:

wp_list_pluck() performance improvement. Props Otto42. fixes #18230

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r18589 r18602  
    32213221function wp_list_pluck( $list, $field ) { 
    32223222    foreach ( $list as $key => $value ) { 
    3223         $value = (array) $value; 
    3224         $list[ $key ] = $value[ $field ]; 
     3223        if ( is_object( $value ) ) 
     3224            $list[ $key ] = $value->$field; 
     3225        else 
     3226            $list[ $key ] = $value[ $field ]; 
    32253227    } 
    32263228 
Note: See TracChangeset for help on using the changeset viewer.