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