[wp-trac] [WordPress Trac] #37050: Make the `WP_Network` `id` property an int

WordPress Trac noreply at wordpress.org
Sun Jun 26 10:51:44 UTC 2016


#37050: Make the `WP_Network` `id` property an int
--------------------------------------+------------------------
 Reporter:  jeremyfelt                |       Owner:
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  4.6
Component:  Networks and Sites        |     Version:  4.4
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  multisite
--------------------------------------+------------------------
Changes (by flixos90):

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


Comment:

 [attachment:37050.3.diff] is a combination of both previous patches. It
 changes the property itself to be an integer, while it also makes it
 private to be able to use magic methods to ensure the type.

 The patch also adds a unit test for it.

 After discussion at WCEU contributor day, this change is good to go in
 although being backwards-incompatible. The network class is not widely
 used and strict comparisons shouldn't be used with something as unclear as
 an ID field where it's unknown whether it's string or int. The change
 doesn't need an extra dev-note, but should be mentioned in the global
 multisite changes note.

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


More information about the wp-trac mailing list