[wp-trac] [WordPress Trac] #28290: Changing _site_option functions for _network_option functions

WordPress Trac noreply at wordpress.org
Sun Sep 13 06:26:16 UTC 2015


#28290: Changing _site_option functions for _network_option functions
--------------------------------+------------------------
 Reporter:  jmlapam             |       Owner:
     Type:  enhancement         |      Status:  reopened
 Priority:  normal              |   Milestone:  4.4
Component:  Networks and Sites  |     Version:  4.0
 Severity:  normal              |  Resolution:
 Keywords:  needs-patch         |     Focuses:  multisite
--------------------------------+------------------------

Comment (by spacedmonkey):

 I would be interested in writing the patch for this. Couple of questions
 then.

 - Should the patch leverage and wrap, the functions I changed in #33814 ?
 - Do I also need to write unit tests for these new functions?

 Now for my ideas on what should be in this patch.

 Was thinking about the ordering of the params and think that network id
 should be last. It makes the functions much more usable, as most users of
 multisite only have one network. Here are a list of the functions and
 parms.

 get_network_option( $option, $default = false, $network_id = false )
 add_network_option( $option, $value, $network_id = false )
 update_network_option( $option, $value, $network_id = false )
 delete_network_option( $option, $network_id = false )

 We should also add get_current_network_id() function. It can be used
 inside above functions if network_id is false / 0. It is also confusing
 why this function doesn't already exists as get_current_blog_id exists.

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


More information about the wp-trac mailing list