Make WordPress Core

Ticket #53988: 53988.diff

File 53988.diff, 1.3 KB (added by SergeyBiryukov, 3 years ago)
  • src/wp-includes/class-wp-list-util.php

     
    102102                $operator = strtoupper( $operator );
    103103
    104104                if ( ! in_array( $operator, array( 'AND', 'OR', 'NOT' ), true ) ) {
    105                         return array();
     105                        $this->output = array();
     106                        return $this->output;
    106107                }
    107108
    108109                $count    = count( $args );
  • src/wp-includes/functions.php

     
    49034903 *
    49044904 * @since 3.1.0
    49054905 * @since 4.7.0 Uses `WP_List_Util` class.
     4906 * @since 5.9.0 Converted into a wrapper for wp_filter_object_list().
    49064907 *
    49074908 * @param array  $list     An array of objects to filter.
    49084909 * @param array  $args     Optional. An array of key => value arguments to match
     
    49144915 * @return array Array of found values.
    49154916 */
    49164917function wp_list_filter( $list, $args = array(), $operator = 'AND' ) {
    4917         if ( ! is_array( $list ) ) {
    4918                 return array();
    4919         }
    4920 
    4921         $util = new WP_List_Util( $list );
    4922 
    4923         return $util->filter( $args, $operator );
     4918        return wp_filter_object_list( $list, $args, $operator );
    49244919}
    49254920
    49264921/**