WordPress.org

Make WordPress Core

Changeset 16161


Ignore:
Timestamp:
11/03/10 13:57:43 (3 years ago)
Author:
ryan
Message:

Lose wildcards in site search. Maybe bring it back as an option. see #15170

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-ms-sites-list-table.php

    r16158 r16161  
    2222 
    2323    function prepare_items() { 
    24         global $s, $mode, $wpdb; 
     24        global $s, $mode, $wpdb, $current_site; 
    2525 
    2626        $mode = ( empty( $_REQUEST['mode'] ) ) ? 'list' : $_REQUEST['mode']; 
     
    4848        if ( isset( $_REQUEST['searchaction'] ) ) { 
    4949            if ( 'name' == $_REQUEST['searchaction'] ) { 
    50                 $query .= " AND ( {$wpdb->blogs}.domain LIKE '%{$like_s}%' OR {$wpdb->blogs}.path LIKE '%{$like_s}%' ) "; 
     50                if ( is_subdomain_install() ) { 
     51                    $like_s = str_replace( '.' . $current_site->domain, '', $like_s ); 
     52                    $like_s .= '.' . $current_site->domain; 
     53                    $query .= " AND {$wpdb->blogs}.domain LIKE '$like_s' "; 
     54                } else { 
     55                    if ( $like_s != trim('/', $current_site->path) ) 
     56                        $like_s = $current_site->path .= $like_s . '/'; 
     57                    $query .= " AND {$wpdb->blogs}.path LIKE '$like_s' "; 
     58                } 
    5159            } elseif ( 'id' == $_REQUEST['searchaction'] ) { 
    5260                $query .= " AND {$wpdb->blogs}.blog_id = '{$like_s}' "; 
Note: See TracChangeset for help on using the changeset viewer.