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:
Ryan Boren 2011-02-09 17:06:22 +00:00
parent bc17de6453
commit 40ef969983
1 changed files with 6 additions and 0 deletions

View File

@ -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;