[wp-trac] [WordPress Trac] #37958: Improve looping through sites and restoring

WordPress Trac noreply at wordpress.org
Tue Sep 6 18:12:11 UTC 2016


#37958: Improve looping through sites and restoring
--------------------------------+-------------------------------------
 Reporter:  tfrommen            |       Owner:
     Type:  enhancement         |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  Networks and Sites  |     Version:
 Severity:  normal              |  Resolution:
 Keywords:                      |     Focuses:  multisite, performance
--------------------------------+-------------------------------------

Comment (by tfrommen):

 Also, if introducing a static class method might be seen as something too
 confusing for non-OOP developers (as discussed in #37699), we could
 (also?) provide a global function that just returns a new `NetworkState`
 instance.

 {{{#!php
 <?php
 /**
  * Returns a new network state instance.
  *
  * @return NetworkState A fresh network state object.
  */
 function get_network_state() {

     return new NetworkState();
 }
 }}}

 Or just do regular instatiation (i.e., `$network_state = new
 NetworkState();`).

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


More information about the wp-trac mailing list