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

WordPress Trac noreply at wordpress.org
Wed Oct 14 16:50:07 UTC 2015


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

Comment (by toscho):

 Replying to [comment:49 jeremyfelt]:

 > * Most related objects in core have public properties. It's an
 expectation of sorts.

 This is one of the main causes for plugin incompatibilities. It is an
 extremely bad pattern.

 > * We're introducing this as the way to populate `$current_site`, which
 has assumed properties that have been stomped on for years. We risk
 breakage if we make those properties private all of a sudden.

 Then just use `__get( $name )`. That solves the problem without direct
 write access. Just make sure that a property is always the same, no matter
 when I'm calling it.

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


More information about the wp-trac mailing list