Make WordPress Core


Ignore:
Timestamp:
06/17/2016 12:02:05 AM (6 years ago)
Author:
jeremyfelt
Message:

Multisite: Use WP_Site_Query to power WP_MS_Sites_List_Table.

WP_Site_Query provides for a cleaner prepare_items() method. It significantly improves the search experience in the sites list table:

  • In a subdomain configuration, domain and path are searched for a provided terms.
  • In a subdirectory configuration, path is searched for a provided term.
  • The full domain is searched in a subdomain configuration rather than the portion not matching the network's domain.
  • Terms are searched as %term% by default. Adding * in the middle of a term will search %te%rm%.

Props flixos90, Fab1en.
Fixes #33185, #24833, #21837, #36675.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/multisite/wpMSSitesListTable.php

    r37633 r37736  
    7474        $expected = array(
    7575            self::$site_ids['wordpress.org/foo/'],
     76            self::$site_ids['wordpress.org/foo/bar/'],
     77            self::$site_ids['wordpress.org/afoo/'],
    7678            self::$site_ids['make.wordpress.org/foo/'],
    7779            self::$site_ids['www.w.org/foo/'],
     80            self::$site_ids['www.w.org/foo/bar/'],
    7881        );
    7982
     
    132135        $expected = array(
    133136            self::$site_ids['test.example.org/'],
     137            self::$site_ids['test2.example.org/'],
     138            self::$site_ids['test3.example.org/zig/'],
     139            self::$site_ids['atest.example.org/'],
    134140        );
    135141
     
    155161            self::$site_ids['test2.example.org/'],
    156162            self::$site_ids['test3.example.org/zig/'],
     163            self::$site_ids['atest.example.org/'],
    157164        );
    158165
     
    177184            self::$site_ids['wordpress.org/foo/'],
    178185            self::$site_ids['wordpress.org/foo/bar/'],
     186            self::$site_ids['wordpress.org/afoo/'],
    179187            self::$site_ids['make.wordpress.org/foo/'],
    180188            self::$site_ids['www.w.org/foo/'],
Note: See TracChangeset for help on using the changeset viewer.