[wp-trac] [WordPress Trac] #31148: Extend wp_get_sites() to support queries on domain and path
WordPress Trac
noreply at wordpress.org
Tue Mar 8 01:11:19 UTC 2016
#31148: Extend wp_get_sites() to support queries on domain and path
-------------------------------------------------+-------------------------
Reporter: earnjam | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future
Component: Networks and Sites | Release
Severity: normal | Version:
Keywords: needs-testing has-patch 4.6-early | Resolution:
needs-unit-tests | Focuses: multisite
-------------------------------------------------+-------------------------
Changes (by jeremyfelt):
* keywords: dev-feedback needs-testing has-patch => needs-testing has-
patch 4.6-early needs-unit-tests
Comment:
Thanks @spacedmonkey, looking good! (And thanks @earnjam for the initial
stab at this.)
Some notes while going through the patch:
* In the first iteration, I think I'd prefer sticking to `ids` and `all`
for fields. We can work through #35697 a bit more to decide what else
would be useful.
* We previously restricted to `wp_is_large_network()`. We should probably
consider moving away from that, especially with the default limit at 100.
* Supporting date queries would be interesting for the `registered` and
`last_updated` fields.
* We could probably support `path` in `orderby` as well. Someone ''may''
want to order by one of the other properties, but it seems unlikely.
* When `ids` is passed for fields, we should use `$wpdb->get_col()`
instead (see `WP_Query`) so that we have an array of IDs rather than the
same associative array.
I think things are in a nice place. Some unit tests would be helpful as
well. It would also be interesting to start iterating on this now into a
`WP_Site_Query` for 4.6 rather than waiting.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31148#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list