Move _wp_search_sql() into WP_Object_Query. Introduce WP_Comment_Search. See #15032

git-svn-id: http://svn.automattic.com/wordpress/trunk@15723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
scribu
2010-10-04 21:05:31 +00:00
parent 38b834c848
commit 31797f691a
4 changed files with 140 additions and 132 deletions
-20
View File
@@ -4236,26 +4236,6 @@ function get_file_data( $file, $default_headers, $context = '' ) {
return $file_data;
}
/*
* Used internally to generate an SQL string for searching across multiple columns
*
* @access private
* @since 3.1.0
*
* @param string $string
* @param array $cols
* @return string
*/
function _wp_search_sql($string, $cols) {
$string = esc_sql($string);
$searches = array();
foreach ( $cols as $col )
$searches[] = "$col LIKE '%$string%'";
return ' AND (' . implode(' OR ', $searches) . ')';
}
/*
* Used internally to tidy up the search terms
*