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

WordPress Trac noreply at wordpress.org
Wed Jun 8 09:28:26 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:  dev-feedback 2nd-opinion  |     Focuses:  multisite
--------------------------------------+------------------------

Comment (by flixos90):

 [attachment:37050.2.diff] makes a few adjustments:

 * instead of actually making the property an integer, leave the property
 as string and make it private (similar like with the other changes in
 #36717)
 * when writing the property, ensure it is a string
 * when reading the property, ensure it returns an integer
 * a minor additional change: I changed the default for `$blog_id` from
 integer to string so that it matches the described type

 @jeremyfelt I think this method is more in line with the changes from
 #36717 and we keep the internals the same types like before. Let's discuss
 which route we wanna go. One issue with your patch was that `$id` was
 still a public property, so the magic get method that would ensure it
 returned an integer was never triggered.

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


More information about the wp-trac mailing list