Ticket #53988: 53988.diff
File 53988.diff, 1.3 KB (added by , 3 years ago) |
---|
-
src/wp-includes/class-wp-list-util.php
102 102 $operator = strtoupper( $operator ); 103 103 104 104 if ( ! in_array( $operator, array( 'AND', 'OR', 'NOT' ), true ) ) { 105 return array(); 105 $this->output = array(); 106 return $this->output; 106 107 } 107 108 108 109 $count = count( $args ); -
src/wp-includes/functions.php
4903 4903 * 4904 4904 * @since 3.1.0 4905 4905 * @since 4.7.0 Uses `WP_List_Util` class. 4906 * @since 5.9.0 Converted into a wrapper for wp_filter_object_list(). 4906 4907 * 4907 4908 * @param array $list An array of objects to filter. 4908 4909 * @param array $args Optional. An array of key => value arguments to match … … 4914 4915 * @return array Array of found values. 4915 4916 */ 4916 4917 function 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 ); 4924 4919 } 4925 4920 4926 4921 /**