Return early if list is not an array. Props nacin. fixes #16499 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@17427 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
bc17de6453
commit
40ef969983
|
@ -3034,6 +3034,9 @@ function wp_array_slice_assoc( $array, $keys ) {
|
|||
* @return array A list of objects or object fields
|
||||
*/
|
||||
function wp_filter_object_list( $list, $args = array(), $operator = 'and', $field = false ) {
|
||||
if ( ! is_array( $list ) )
|
||||
return array();
|
||||
|
||||
$list = wp_list_filter( $list, $args, $operator );
|
||||
|
||||
if ( $field )
|
||||
|
@ -3057,6 +3060,9 @@ function wp_filter_object_list( $list, $args = array(), $operator = 'and', $fiel
|
|||
* @return array
|
||||
*/
|
||||
function wp_list_filter( $list, $args = array(), $operator = 'AND' ) {
|
||||
if ( ! is_array( $list ) )
|
||||
return array();
|
||||
|
||||
if ( empty( $args ) )
|
||||
return $list;
|
||||
|
||||
|
|
Loading…
Reference in New Issue