Make WordPress Core


Ignore:
Timestamp:
06/26/2016 01:22:36 PM (10 years ago)
Author:
jeremyfelt
Message:

Multisite: Change WP_Network id property to an integer.

For consistency and developer sanity.

Props flixos90.
Fixes #37050.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-network.php

    r37658 r37870  
    1919 * @since 4.4.0
    2020 *
     21 * @property int $id
    2122 * @property int $site_id
    2223 */
    … …  
    2627         * Network ID.
    2728         *
    28          * A numeric string, for compatibility reasons.
    29          *
    30          * @since 4.4.0
    31          * @access public
    32          * @var string
    33          */
    34         public $id;
     29         * @since 4.4.0
     30         * @since 4.6.0 Type changed from string to int.
     31         * @access private
     32         * @var int
     33         */
     34        private $id;
    3535
    3636        /**
    … …  
    153153        public function __get( $key ) {
    154154                switch ( $key ) {
     155                        case 'id';
     156                                return (int) $this->id;
    155157                        case 'blog_id':
    156158                                return $this->blog_id;
    … …  
    175177        public function __isset( $key ) {
    176178                switch ( $key ) {
     179                        case 'id':
    177180                        case 'blog_id':
    178181                        case 'site_id':
    … …  
    196199        public function __set( $key, $value ) {
    197200                switch ( $key ) {
     201                        case 'id':
     202                                $this->id = (int) $value;
     203                                break;
    198204                        case 'blog_id':
    199205                        case 'site_id':
Note: See TracChangeset for help on using the changeset viewer.