Make WordPress Core


Ignore:
Timestamp:
08/11/2010 09:54:51 PM (16 years ago)
Author:
scribu
Message:

Ajaxify list-type screens in the admin. See #14579

File:
1 edited

Legend:

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

    r15355 r15491  
    41954195        return $file_data;
    41964196}
     4197
     4198/*
     4199 * Used internally to generate an SQL string for searching across multiple columns
     4200 *
     4201 * @access private
     4202 * @since 3.1.0
     4203 *
     4204 * @param string $string
     4205 * @param array $cols
     4206 * @return string
     4207 */
     4208function _wp_search_sql($string, $cols) {
     4209        $string = esc_sql($string);
     4210
     4211        $searches = array();
     4212        foreach ( $cols as $col )
     4213                $searches[] = "$col LIKE '%$string%'";
     4214
     4215        return ' AND (' . implode(' OR ', $searches) . ')';
     4216}
     4217
    41974218/*
    41984219 * Used internally to tidy up the search terms
Note: See TracChangeset for help on using the changeset viewer.