WordPress.org

Make WordPress Core

Ticket #27918: 27918.diff

File 27918.diff, 854 bytes (added by bobbingwide, 7 years ago)

wp_list_filter() cater for $m_value being an array

  • wp-includes/functions.php

     
    28472847
    28482848                $matched = 0;
    28492849                foreach ( $args as $m_key => $m_value ) {
    2850                         if ( array_key_exists( $m_key, $to_match ) && $m_value == $to_match[ $m_key ] )
    2851                                 $matched++;
     2850                        if ( array_key_exists( $m_key, $to_match ) ) {
     2851        if ( $m_value == $to_match[ $m_key ] ) {
     2852                                  $matched++;
     2853        } elseif ( is_array( $m_value ) && is_array( $to_match[ $m_key ] ) ) {
     2854          foreach ( $m_value as $mv_key => $mv_value ) {
     2855            if ( in_array( $mv_value, $to_match[ $m_key ] ) ) {
     2856              $matched = $count;
     2857            }
     2858          } 
     2859        }
     2860      }
    28522861                }
    28532862
    28542863                if ( ( 'AND' == $operator && $matched == $count )