Changeset 16351
- Timestamp:
- 11/13/2010 06:18:45 PM (14 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-object-query.php
r16267 r16351 71 71 $qv['meta_query'] = $meta_query; 72 72 } 73 74 /*75 * Used internally to generate an SQL string for searching across multiple columns76 *77 * @access protected78 * @since 3.1.079 *80 * @param string $string81 * @param array $cols82 * @param bool $wild Whether to allow trailing wildcard searches. Default is false.83 * @return string84 */85 function get_search_sql( $string, $cols, $wild = false ) {86 $string = esc_sql( $string );87 88 $searches = array();89 $wild_char = ( $wild ) ? '%' : '';90 foreach ( $cols as $col ) {91 if ( 'ID' == $col )92 $searches[] = "$col = '$string'";93 else94 $searches[] = "$col LIKE '$string$wild_char'";95 }96 97 return ' AND (' . implode(' OR ', $searches) . ')';98 }99 73 } 100 74 -
trunk/wp-includes/comment.php
r16149 r16351 342 342 return $comments; 343 343 } 344 345 /* 346 * Used internally to generate an SQL string for searching across multiple columns 347 * 348 * @access protected 349 * @since 3.1.0 350 * 351 * @param string $string 352 * @param array $cols 353 * @return string 354 */ 355 function get_search_sql( $string, $cols ) { 356 $string = esc_sql( $string ); 357 358 $searches = array(); 359 foreach ( $cols as $col ) 360 $searches[] = "$col LIKE '%$string%'"; 361 362 return ' AND (' . implode(' OR ', $searches) . ')'; 363 } 344 364 } 345 365 -
trunk/wp-includes/user.php
r16286 r16351 527 527 } 528 528 529 /* 530 * Used internally to generate an SQL string for searching across multiple columns 531 * 532 * @access protected 533 * @since 3.1.0 534 * 535 * @param string $string 536 * @param array $cols 537 * @param bool $wild Whether to allow trailing wildcard searches. Default is false. 538 * @return string 539 */ 540 function get_search_sql( $string, $cols, $wild = false ) { 541 $string = esc_sql( $string ); 542 543 $searches = array(); 544 $wild_char = ( $wild ) ? '%' : ''; 545 foreach ( $cols as $col ) { 546 if ( 'ID' == $col ) 547 $searches[] = "$col = '$string'"; 548 else 549 $searches[] = "$col LIKE '$string$wild_char'"; 550 } 551 552 return ' AND (' . implode(' OR ', $searches) . ')'; 553 } 554 529 555 /** 530 556 * Return the list of users
Note: See TracChangeset
for help on using the changeset viewer.