Check if array key exists in wp_list_filter(). props wpsmith. fixes #20929.

git-svn-id: http://core.svn.wordpress.org/trunk@21184 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2012-06-29 19:42:27 +00:00
parent 76defb20d4
commit 34c74ee8ce
1 changed files with 1 additions and 1 deletions

View File

@ -2402,7 +2402,7 @@ function wp_list_filter( $list, $args = array(), $operator = 'AND' ) {
$matched = 0; $matched = 0;
foreach ( $args as $m_key => $m_value ) { foreach ( $args as $m_key => $m_value ) {
if ( $m_value == $to_match[ $m_key ] ) if ( array_key_exists( $m_key, $to_match ) && $m_value == $to_match[ $m_key ] )
$matched++; $matched++;
} }