[wp-trac] [WordPress Trac] #31985: WP_Network class

WordPress Trac noreply at wordpress.org
Sun Sep 6 03:25:21 UTC 2015


#31985: WP_Network class
------------------------------------+-------------------------
 Reporter:  johnjamesjacoby         |       Owner:  jeremyfelt
     Type:  task (blessed)          |      Status:  accepted
 Priority:  normal                  |   Milestone:  4.4
Component:  Networks and Sites      |     Version:  3.0
 Severity:  normal                  |  Resolution:
 Keywords:  dev-feedback has-patch  |     Focuses:  multisite
------------------------------------+-------------------------
Changes (by jeremyfelt):

 * keywords:  dev-feedback => dev-feedback has-patch
 * owner:   => jeremyfelt
 * type:  enhancement => task (blessed)
 * status:  new => accepted
 * milestone:  Future Release => 4.4


Comment:

 I spent a bunch more time staring at this today and ended up with
 [https://core.trac.wordpress.org/attachment/ticket/31985/31985.4.diff
 31985.4.diff]. Here are some of my thoughts throughout and changes in
 comparison to previous patches.

 * I scaled back on the reorganization of bootstrap code in `ms-
 settings.php`. IMO, it doesn't feel right to consolidate that as part of
 this ticket. There was a point when I realized we were no longer
 populating the `$domain` and `$path` globals and I decided to leave it all
 alone to help make a smaller patch. I think we should address this in a
 future ticket.
 * Moved `WP_Network::get_by_id()` to `WP_Network::get_instance()` to
 mirror what `WP_Post` and `WP_Comment` do.
 * Made `WP_Network()` expect a standard network object in `__construct()`
 that it could then use to populate the remainder of the object, also
 mirroring what `WP_Post` and `WP_Comment` do.
 * Changed `WP_Network::get_core_options()` to
 `WP_Network::load_core_options()` to better match the spirit and
 functionality of `wp_load_core_site_options()`, which it replaces. At
 first it seemed like a great idea to load the options into a property and
 reuse them, but we then skip the filters normally used in
 `get_site_option()`. I'd still like to consider wrapping this at some
 point in the future, but we need to support different network IDs when
 looking at network options. I think this can be another ticket. In the
 meantime, we have the opportunity to load any network's main options into
 cache if a persistent object cache is not available.
 * Removed `WP_Network::get_active_network_plugins()` and
 `WP_Network:validate_network_plugin()` because of the core options issue.
 I think we can reconsider this in the future as well.
 * Removed the add, update, and delete methods as I don't think we want to
 support CRUD in a first version. I don't have any issues supporting it
 soon after though. This would really be a new feature.

 I think we're getting close. :)

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


More information about the wp-trac mailing list