Changeset 53280 for trunk/src/wp-includes/class-wp-user-query.php
- Timestamp:
- 04/26/2022 02:02:14 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-user-query.php
r53276 r53280 869 869 * @global wpdb $wpdb WordPress database abstraction object. 870 870 * 871 * @param string $search872 * @param array $cols873 * @param bool $wildWhether to allow wildcard searches. Default is false for Network Admin, true for single site.874 * Single site allows leading and trailing wildcards, Network Admin only trailing.871 * @param string $search Search string. 872 * @param string[] $columns Array of columns to search. 873 * @param bool $wild Whether to allow wildcard searches. Default is false for Network Admin, true for single site. 874 * Single site allows leading and trailing wildcards, Network Admin only trailing. 875 875 * @return string 876 876 */ 877 protected function get_search_sql( $search, $col s, $wild = false ) {877 protected function get_search_sql( $search, $columns, $wild = false ) { 878 878 global $wpdb; 879 879 … … 883 883 $like = $leading_wild . $wpdb->esc_like( $search ) . $trailing_wild; 884 884 885 foreach ( $col s as $col) {886 if ( 'ID' === $col ) {887 $searches[] = $wpdb->prepare( "$col = %s", $search );885 foreach ( $columns as $column ) { 886 if ( 'ID' === $column ) { 887 $searches[] = $wpdb->prepare( "$column = %s", $search ); 888 888 } else { 889 $searches[] = $wpdb->prepare( "$col LIKE %s", $like );889 $searches[] = $wpdb->prepare( "$column LIKE %s", $like ); 890 890 } 891 891 }
Note: See TracChangeset
for help on using the changeset viewer.