WordPress.org

Make WordPress Core

Ticket #16137: 16137.diff

File 16137.diff, 639 bytes (added by scribu, 2 years ago)
  • wp-includes/functions.php

     
    30623062        $filtered = array(); 
    30633063 
    30643064        foreach ( $list as $key => $obj ) { 
    3065                 $matched = count( array_intersect_assoc( (array) $obj, $args ) ); 
     3065                $to_match = (array) $obj; 
     3066 
     3067                $matched = 0; 
     3068                foreach ( $args as $m_key => $m_value ) { 
     3069                        if ( $m_value == $to_match[$m_key] ) 
     3070                                $matched++; 
     3071                } 
     3072 
    30663073                if ( ('and' == $operator && $matched == $count) || ('or' == $operator && $matched <= $count) ) { 
    30673074                        $filtered[$key] = $obj; 
    30683075                }