Make WordPress Core


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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.