WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/19/2014 06:51:35 AM (7 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/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
Note: See TracChangeset for help on using the changeset viewer.