WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #18230, comment 3


Ignore:
Timestamp:
07/24/2011 09:00:07 AM (7 years ago)
Author:
xknown
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18230, comment 3

    initial v1  
    11Using isset instead of is_object is a little bit faster apparently.
    22{{{
    3 function new_wp_list_pluck( $list, $field ) {
     3function new1_wp_list_pluck( $list, $field ) {
    44        foreach ( $list as $key => $value ) {
    55                if ( isset( $value->$field ) ) $list[$key] = $value->$field;
     
    1010}
    1111}}}
     12A simple test with 27 terms.
     13{{{
     14float(0.71514010429382) // old_wp_list_pluck
     15float(0.33222508430481) // new_wp_list_pluck
     16float(0.26003003120422) // new1_wp_list_pluck
     17}}}