Ticket #35087: 35087.diff
File 35087.diff, 1.2 KB (added by , 9 years ago) |
---|
-
src/wp-includes/functions.php
3371 3371 * This is simple. Could at some point wrap array_column() 3372 3372 * if we knew we had an array of arrays. 3373 3373 */ 3374 foreach ( $list as $key => $value ) {3374 foreach ( (array) $list as $key => $value ) { 3375 3375 if ( is_object( $value ) ) { 3376 3376 $list[ $key ] = $value->$field; 3377 3377 } else { -
tests/phpunit/tests/functions/listFilter.php
110 110 $this->assertEquals( array( 'f' => 'foo', 'b' => 'bar', 'z' => 'baz' ), $list ); 111 111 } 112 112 113 /** 114 * @ticket 35087 115 */ 116 function test_wp_list_pluck_non_array() { 117 $list = wp_list_pluck( false, 'name' ); 118 $this->assertEquals( [ 0 => null ], $list ); 119 } 120 113 121 function test_filter_object_list_nested_array_and() { 114 122 $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'AND' ); 115 123 $this->assertEquals( 1, count( $list ) );