[wp-trac] [WordPress Trac] #37948: Use `WP_Site` class globally

WordPress Trac noreply at wordpress.org
Tue Sep 6 09:53:49 UTC 2016


#37948: Use `WP_Site` class globally
-------------------------------------------------+-------------------------
 Reporter:  flixos90                             |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Networks and Sites                   |  Review
 Severity:  normal                               |     Version:
 Keywords:  has-patch needs-unit-tests 2nd-      |  Resolution:
  opinion                                        |     Focuses:  multisite
-------------------------------------------------+-------------------------
Changes (by flixos90):

 * keywords:  needs-patch => has-patch needs-unit-tests 2nd-opinion


Comment:

 [attachment:37948.diff] makes `WP_Site` compatible with non-multisite
 installs and loads it on these setups as well.

 Questions from my end:
 * Should we prevent calling the `get_details()` method when the `$blog_id`
 property is something other than 1 (there's no such site on a regular
 setup)?
 * Should we make the function `get_site()` compatible as well and load it
 everywhere too? My first thought would be no, since this `WP_Site` use-
 case on a regular setup is very specific and it should be sufficient to
 have only the class available.

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


More information about the wp-trac mailing list