Changeset 16168
- Timestamp:
- 11/03/2010 07:02:42 PM (14 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-object-query.php
r16143 r16168 234 234 235 235 $searches = array(); 236 foreach ( $cols as $col ) 237 $searches[] = "$col LIKE '%$string%'"; 236 foreach ( $cols as $col ) { 237 if ( 'ID' == $col ) 238 $searches[] = "$col = '$string'"; 239 else 240 $searches[] = "$col LIKE '$string%'"; 241 } 238 242 239 243 return ' AND (' . implode(' OR ', $searches) . ')'; -
trunk/wp-includes/user.php
r16160 r16168 447 447 $search = trim( $qv['search'] ); 448 448 if ( $search ) { 449 $this->query_where .= $this->get_search_sql( $search, array( 'user_login', 'user_nicename', 'user_email', 'user_url', 'display_name' ) ); 449 if ( false !== strpos( $search, '@') ) 450 $search_columns[] = array('user_email'); 451 elseif ( is_numeric($search) ) 452 $search_columns = array('user_login', 'ID'); 453 elseif ( preg_match('|^https?://|', $search) ) 454 $search_columns = array('user_url'); 455 else 456 $search_columns = array('user_login', 'user_nicename', 'display_name'); 457 458 $this->query_where .= $this->get_search_sql( $search, $search_columns ); 450 459 } 451 460
Note: See TracChangeset
for help on using the changeset viewer.