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

WordPress Trac noreply at wordpress.org
Thu Jun 2 00:08:05 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 has-unit-    |     Focuses:  multisite
  tests needs-dev-note                           |
-------------------------------------------------+-------------------------

Comment (by dd32):

 Just wanted to quickly weigh in on the usage of `ARRAY_A` here.. is it
 really needed? and when would you ever want to do `ARRAY_N`?

 It looks like it's being used for BC, but, it feels like that if the
 calling function is needing BC-data, it should be the one to massage the
 new API's return format into something it understands. (ie. in r37617, it
 should just be `$results[] = (array) get_site( $_site );`)

 A potentially better option would even to just implement `ArrayAccess` for
 `WP_Site` instead (Although that'll fail any `is_array()` checks that
 people have added for some reason) but has the potential to reduce issues
 and give a consistent object for the future.. unlike this, where legacy
 code will still be passing arrays around, when it could just be using a
 `WP_Site` object,  reducing the amount of changes needed to "upgrade".

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


More information about the wp-trac mailing list