[wp-trac] [WordPress Trac] #35791: WP_Site_Query class

WordPress Trac noreply at wordpress.org
Mon May 2 23:19:31 UTC 2016

#35791: WP_Site_Query class
 Reporter:  spacedmonkey                         |       Owner:  jeremyfelt
     Type:  task (blessed)                       |      Status:  reviewing
 Priority:  normal                               |   Milestone:  4.6
Component:  Networks and Sites                   |     Version:  4.4
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing needs-unit-  |     Focuses:  multisite
  tests                                          |

Comment (by spacedmonkey):

 Replying to [comment:31 ocean90]:
 > Replying to [comment:21 spacedmonkey]:
 > > Going forward, I think we should deprecate wp_get_sites, as get_sites
 should replace it.
 > I'm not sure if that's a good idea. `get_sites()` sounds to generic and
 could cause fatal errors if there are plugins/themes which define the same
 function (Yes, without a prefix).

 I am not sure that I agree. All of object types have a get_*s function. I
 know that they might be issues with adding new functions to core, but that
 is the risk that you take everytime a new function is added right? I don't
 see why we should have the design pattern for this one function. Wouldn't
 be do that everytime we add a new function into core going forward?

 Regarding unit testing. The unit tests now pass for multisite. As in
 implementation we use query class, we already have some test coverage.
 wp_get_sites and domain_exists seem a good start for new tests, if they
 are required.

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

More information about the wp-trac mailing list