WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/04/2010 09:05:31 PM (10 years ago)
Author:
scribu
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r15715 r15723  
    42384238
    42394239/*
    4240  * Used internally to generate an SQL string for searching across multiple columns
    4241  *
    4242  * @access private
    4243  * @since 3.1.0
    4244  *
    4245  * @param string $string
    4246  * @param array $cols
    4247  * @return string
    4248  */
    4249 function _wp_search_sql($string, $cols) {
    4250     $string = esc_sql($string);
    4251 
    4252     $searches = array();
    4253     foreach ( $cols as $col )
    4254         $searches[] = "$col LIKE '%$string%'";
    4255 
    4256     return ' AND (' . implode(' OR ', $searches) . ')';
    4257 }
    4258 
    4259 /*
    42604240 * Used internally to tidy up the search terms
    42614241 *
Note: See TracChangeset for help on using the changeset viewer.