Make WordPress Core

Changeset 28524


Ignore:
Timestamp:
05/19/2014 06:51:35 AM (12 years ago)
Author:
wonderboymusic
Message:

Classes that have __set() also need __isset() and __unset().

See #27881, #22234.

Location:
trunk/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/custom-background.php

    r28521 r28524  
    8282        }
    8383
     84        /**
     85         * Make private properties checkable for backwards compatibility
     86         *
     87         * @since 4.0.0
     88         * @param string $name
     89         * @return mixed
     90         */
     91        public function __isset( $name ) {
     92                return isset( $this->$name );
     93        }
     94
     95        /**
     96         * Make private properties unsetable for backwards compatibility
     97         *
     98         * @since 4.0.0
     99         * @param string $name
     100         * @return mixed
     101         */
     102        public function __unset( $name ) {
     103                unset( $this->$name );
     104        }
    84105
    85106        /**
  • trunk/src/wp-admin/custom-header.php

    r28521 r28524  
    102102        public function __set( $name, $value ) {
    103103                return $this->$name = $value;
     104        }
     105
     106        /**
     107         * Make private properties checkable for backwards compatibility
     108         *
     109         * @since 4.0.0
     110         * @param string $name
     111         * @return mixed
     112         */
     113        public function __isset( $name ) {
     114                return isset( $this->$name );
     115        }
     116
     117        /**
     118         * Make private properties unsetable for backwards compatibility
     119         *
     120         * @since 4.0.0
     121         * @param string $name
     122         * @return mixed
     123         */
     124        public function __unset( $name ) {
     125                unset( $this->$name );
    104126        }
    105127
  • trunk/src/wp-admin/includes/class-wp-filesystem-base.php

    r28521 r28524  
    6666        public function __set( $name, $value ) {
    6767                return $this->$name = $value;
     68        }
     69
     70        /**
     71         * Make private properties checkable for backwards compatibility
     72         *
     73         * @since 4.0.0
     74         * @param string $name
     75         * @return mixed
     76         */
     77        public function __isset( $name ) {
     78                return isset( $this->$name );
     79        }
     80
     81        /**
     82         * Make private properties unsetable for backwards compatibility
     83         *
     84         * @since 4.0.0
     85         * @param string $name
     86         * @return mixed
     87         */
     88        public function __unset( $name ) {
     89                unset( $this->$name );
    6890        }
    6991
  • trunk/src/wp-admin/includes/class-wp-list-table.php

    r28521 r28524  
    117117        public function __set( $name, $value ) {
    118118                return $this->$name = $value;
     119        }
     120
     121        /**
     122         * Make private properties checkable for backwards compatibility
     123         *
     124         * @since 4.0.0
     125         * @param string $name
     126         * @return mixed
     127         */
     128        public function __isset( $name ) {
     129                return isset( $this->$name );
     130        }
     131
     132        /**
     133         * Make private properties unsetable for backwards compatibility
     134         *
     135         * @since 4.0.0
     136         * @param string $name
     137         * @return mixed
     138         */
     139        public function __unset( $name ) {
     140                unset( $this->$name );
    119141        }
    120142
  • trunk/src/wp-includes/cache.php

    r28521 r28524  
    328328        public function __set( $name, $value ) {
    329329                return $this->$name = $value;
     330        }
     331
     332        /**
     333         * Make private properties checkable for backwards compatibility
     334         *
     335         * @since 4.0.0
     336         * @param string $name
     337         * @return mixed
     338         */
     339        public function __isset( $name ) {
     340                return isset( $this->$name );
     341        }
     342
     343        /**
     344         * Make private properties unsetable for backwards compatibility
     345         *
     346         * @since 4.0.0
     347         * @param string $name
     348         * @return mixed
     349         */
     350        public function __unset( $name ) {
     351                unset( $this->$name );
    330352        }
    331353
  • trunk/src/wp-includes/class-wp-ajax-response.php

    r28521 r28524  
    5151        public function __set( $name, $value ) {
    5252                return $this->$name = $value;
     53        }
     54
     55        /**
     56         * Make private properties checkable for backwards compatibility
     57         *
     58         * @since 4.0.0
     59         * @param string $name
     60         * @return mixed
     61         */
     62        public function __isset( $name ) {
     63                return isset( $this->$name );
     64        }
     65
     66        /**
     67         * Make private properties unsetable for backwards compatibility
     68         *
     69         * @since 4.0.0
     70         * @param string $name
     71         * @return mixed
     72         */
     73        public function __unset( $name ) {
     74                unset( $this->$name );
    5375        }
    5476
  • trunk/src/wp-includes/class-wp-error.php

    r28521 r28524  
    8686        public function __set( $name, $value ) {
    8787                return $this->$name = $value;
     88        }
     89
     90        /**
     91         * Make private properties checkable for backwards compatibility
     92         *
     93         * @since 4.0.0
     94         * @param string $name
     95         * @return mixed
     96         */
     97        public function __isset( $name ) {
     98                return isset( $this->$name );
     99        }
     100
     101        /**
     102         * Make private properties unsetable for backwards compatibility
     103         *
     104         * @since 4.0.0
     105         * @param string $name
     106         * @return mixed
     107         */
     108        public function __unset( $name ) {
     109                unset( $this->$name );
    88110        }
    89111
  • trunk/src/wp-includes/class-wp-walker.php

    r28521 r28524  
    6161        public function __set( $name, $value ) {
    6262                return $this->$name = $value;
     63        }
     64
     65        /**
     66         * Make private properties checkable for backwards compatibility
     67         *
     68         * @since 4.0.0
     69         * @param string $name
     70         * @return mixed
     71         */
     72        public function __isset( $name ) {
     73                return isset( $this->$name );
     74        }
     75
     76        /**
     77         * Make private properties unsetable for backwards compatibility
     78         *
     79         * @since 4.0.0
     80         * @param string $name
     81         * @return mixed
     82         */
     83        public function __unset( $name ) {
     84                unset( $this->$name );
    6385        }
    6486
  • trunk/src/wp-includes/class-wp.php

    r28521 r28524  
    687687
    688688        /**
     689         * Make private properties checkable for backwards compatibility
     690         *
     691         * @since 4.0.0
     692         * @param string $name
     693         * @return mixed
     694         */
     695        public function __isset( $name ) {
     696                return isset( $this->$name );
     697        }
     698
     699        /**
     700         * Make private properties unsetable for backwards compatibility
     701         *
     702         * @since 4.0.0
     703         * @param string $name
     704         * @return mixed
     705         */
     706        public function __unset( $name ) {
     707                unset( $this->$name );
     708        }
     709
     710        /**
    689711         * Make private/protected methods readable for backwards compatibility
    690712         *
Note: See TracChangeset for help on using the changeset viewer.