[wp-trac] [WordPress Trac] #36675: WP_MS_Sites_List_Table should use WP_Site_Query

WordPress Trac noreply at wordpress.org
Fri Jun 3 00:08:01 UTC 2016


#36675: WP_MS_Sites_List_Table should use WP_Site_Query
----------------------------------------+------------------------
 Reporter:  spacedmonkey                |       Owner:
     Type:  task (blessed)              |      Status:  reopened
 Priority:  normal                      |   Milestone:  4.6
Component:  Networks and Sites          |     Version:  trunk
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:  multisite
----------------------------------------+------------------------

Comment (by jeremyfelt):

 [attachment:36675.2.diff] makes a few changes:

 * Eliminate the `is_subdomain_install()` check so that domain and path are
 always searched for the term.
 * Similarly, only order by domain when `blogname` is passed.
 * Prepend and append `%` to the built wildcard query in `get_search_sql()`
 so that `th*s` turns into `%th%s%` rather than `th%s`.

 The removal of `is_subdomain_install()` is probably overreaching,
 especially with large subdirectory installations. That probably needs to
 go back. With subdomain configurations, we can arbitrarily search
 domain/path at will.

 We [https://core.trac.wordpress.org/ticket/35791#comment:42 talked about
 this briefly], but it would be nice to support a search that includes
 domain and path - `wp.org/foo`. That's probably a future ticket, otherwise
 this may go on a while. :)

 > setting of the order value can probably be simplified since whitelisting
 is already handled in `WP_Site_Query::parse_order()`

 It can be simplified a bit, but the `isset()` for order should probably
 still be used in the ternary so that `ASC` is assigned by default rather
 than order not being populated at all.

 > Another thing we might wanna think about is whether we should move the
 search by IP address bit into WP_Site_Query or not.

 I don't think so. It's super rare and not part of the `$wpdb->blogs`
 table, so we can let it be it's own thing.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36675#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list