Return early if list is not an array. Props nacin. fixes #16499 for trunk

git-svn-id: http://svn.automattic.com/wordpress/trunk@17427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2011-02-09 17:06:22 +00:00
parent f0ad00813e
commit 6fbe3c685d
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;