Changeset 42527 for trunk/src/wp-includes/class-wp-list-util.php
- Timestamp:
- 01/18/2018 05:17:23 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-list-util.php
r42343 r42527 141 141 */ 142 142 public function pluck( $field, $index_key = null ) { 143 $newlist = array(); 144 143 145 if ( ! $index_key ) { 144 146 /* … … 148 150 foreach ( $this->output as $key => $value ) { 149 151 if ( is_object( $value ) ) { 150 $ this->output[ $key ] = $value->$field;152 $newlist[ $key ] = $value->$field; 151 153 } else { 152 $this->output[ $key ] = $value[ $field ]; 153 } 154 } 154 $newlist[ $key ] = $value[ $field ]; 155 } 156 } 157 158 $this->output = $newlist; 159 155 160 return $this->output; 156 161 } … … 160 165 * to the end of the stack. This is how array_column() behaves. 161 166 */ 162 $newlist = array();163 167 foreach ( $this->output as $value ) { 164 168 if ( is_object( $value ) ) {
Note: See TracChangeset
for help on using the changeset viewer.