[wp-trac] [WordPress Trac] #31148: Extend wp_get_sites() to support queries on domain and path

WordPress Trac noreply at wordpress.org
Fri Jan 30 02:58:43 UTC 2015

#31148: Extend wp_get_sites() to support queries on domain and path
 Reporter:  earnjam                              |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Networks and Sites                   |  Review
 Severity:  normal                               |     Version:
 Keywords:  dev-feedback needs-testing has-      |  Resolution:
  patch                                          |     Focuses:  multisite
Changes (by earnjam):

 * keywords:   => dev-feedback needs-testing has-patch


 31148.diff is a first stab at adding parameters for domain, path and a
 boolean to allow the function to run against large networks.

 If it's going to be used for some of these direct queries on the
 `wp_blogs` table, or replace `domain_exists()`, then it needs to have the
 ability to search large networks when required. This patch keeps the
 original functionality of returning an empty array on a large network by
 default unless you explicitly pass it a true value.

 One thing I did notice is that I think `wp_is_large_network()` is only
 checking the size of the current network, so If you run this function from
 within a network with > 10,000 sites, but are trying to search against a
 different small network, it would return an empty array. I guess the
 boolean param I added would allow you to bypass that, but something to
 think about.

Ticket URL: <https://core.trac.wordpress.org/ticket/31148#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list