Changeset 16351 for trunk/wp-includes/class-wp-object-query.php
- Timestamp:
- 11/13/2010 06:18:45 PM (14 years ago)
- File:
-
- 1 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
Note: See TracChangeset
for help on using the changeset viewer.