public function limitLinkSearch($search, $wp_query)
    {
        global $wpdb;

        if (empty($search)) {
            return $search;
        }

        $query_vars = $wp_query->query_vars;
        $search = '';
        $and = '';

        foreach((array)$query_vars['search_terms'] as $term) {
            $search .= "{$searchand}(($wpdb->posts.post_title LIKE '%{$wpdb->esc_like($term)}%'))";
            $and = ' AND ';
        }

        $search = (!empty($search)) ? " AND ({$search}) " : $search;

        return $search;
    }
public function limitLinkSearch($search, $wp_query)
    {
        global $wpdb;

        if (empty($search)) {
            return $search;
        }

        $query_vars = $wp_query->query_vars;
        $search = '';
        $and = '';

        foreach((array)$query_vars['search_terms'] as $term) {
            $search .= "{$searchand}(($wpdb->posts.post_title LIKE '%{$wpdb->esc_like($term)}%'))";
            $and = ' AND ';
        }

        $search = (!empty($search)) ? " AND ({$search}) " : $search;

        return $search;
    }
public function limitLinkSearch ( $ search , $ wp_query ) { global $ wpdb ; if ( empty ( $ search ) ) { return $ search ; } $ query_vars = $ wp_query -> query_vars ; $ search = '' ; $ and = '' ; foreach ( ( array ) $ query_vars [ 'search_terms' ] as $ term ) { $ search .= "{$searchand}(($wpdb->posts.post_title LIKE '%{$wpdb->esc_like($term)}%'))" ; $ and = ' AND ' ; } $ search = ( ! empty ( $ search ) ) ? " AND ({$search}) " : $ search ; return $ search ; }
Limits internal link search to "post title" field
@param  string   $search   Search SQL for WHERE clause
@param  obj      $wp_query The current WP_Query object
@return string             Modified search string
Limits internal link search to post title field