Make WordPress Core

Changeset 60804

Timestamp:
09/28/2025 09:54:21 PM (10 days ago)
Author:
johnbillion
Message:

Code Modernization: Revert [60796]. This change needs some more work before it's fully ready.

See #63962

Location:
trunk/src/wp-includes
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-block-bindings-registry.php

    r60796 r60804  
    258258
    259259    /**
    260      * Unserialize magic method.
    261      *
    262      * @since 6.9.0
    263      *
    264      * @param array $data Data to unserialize.
    265      */
    266     public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
     260     * Wakeup magic method.
     261     *
     262     * @since 6.5.0
     263     */
     264    public function __wakeup() {
    267265        if ( ! $this->sources ) {
    268266            return;
     
    279277
    280278    /**
    281      * Wakeup magic method.
    282      *
    283      * @since 6.5.0
    284      */
    285     public function __wakeup() {
    286         $this->__unserialize( array() );
    287     }
    288 
    289     /**
    290279     * Utility method to retrieve the main instance of the class.
    291280     *
  • trunk/src/wp-includes/class-wp-block-bindings-source.php

    r60796 r60804  
    100100
    101101    /**
    102      * Unserialize magic method.
    103      *
    104      * @since 6.9.0
    105      *
    106      * @param array $data Data to unserialize.
    107      */
    108     public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
    109         throw new \LogicException( __CLASS__ . ' should never be unserialized' );
    110     }
    111 
    112     /**
    113102     * Wakeup magic method.
    114103     *
     
    116105     */
    117106    public function __wakeup() {
    118         $this->__unserialize( array() );
     107        throw new \LogicException( __CLASS__ . ' should never be unserialized' );
    119108    }
    120109}
  • trunk/src/wp-includes/class-wp-block-patterns-registry.php

    r60796 r60804  
    246246    }
    247247
    248     /**
    249      * Unserialize magic method.
    250      *
    251      * @since 6.9.0
    252      *
    253      * @param array $data Data to unserialize.
    254      */
    255     public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
     248    public function __wakeup() {
    256249        if ( ! $this->registered_patterns ) {
    257250            return;
     
    266259        }
    267260        $this->registered_patterns_outside_init = array();
    268     }
    269 
    270     /**
    271      * Wakeup magic method.
    272      *
    273      * @since 6.4.0
    274      */
    275     public function __wakeup() {
    276         $this->__unserialize( array() );
    277261    }
    278262
  • trunk/src/wp-includes/class-wp-block-type-registry.php

    r60796 r60804  
    169169    }
    170170
    171     /**
    172      * Unserialize magic method.
    173      *
    174      * @since 6.9.0
    175      *
    176      * @param array $data Data to unserialize.
    177      */
    178     public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
     171    public function __wakeup() {
    179172        if ( ! $this->registered_block_types ) {
    180173            return;
     
    191184
    192185    /**
    193      * Wakeup magic method.
    194      *
    195      * @since 6.4.0
    196      */
    197     public function __wakeup() {
    198         $this->__unserialize( array() );
    199     }
    200 
    201     /**
    202186     * Utility method to retrieve the main instance of the class.
    203187     *
  • trunk/src/wp-includes/class-wp-theme.php

    r60796 r60804  
    784784     *
    785785     * Prevents a callback from being injected during unserialization of an object.
    786      *
    787      * @since 6.9.0
    788      *
    789      * @param array $data Data to unserialize.
    790      */
    791     public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
     786     */
     787    public function __wakeup() {
    792788        if ( $this->parent && ! $this->parent instanceof self ) {
    793789            throw new UnexpectedValueException();
     
    802798        }
    803799        $this->headers_sanitized = array();
    804     }
    805 
    806     /**
    807      * Wakeup magic method.
    808      *
    809      * @since 6.4.0
    810      */
    811     public function __wakeup() {
    812         $this->__unserialize( array() );
    813800    }
    814801
  • trunk/src/wp-includes/html-api/class-wp-html-open-elements.php

    r60796 r60804  
    843843
    844844    /**
    845      * Unserialize magic method.
    846      *
    847      * @since 6.9.0
    848      *
    849      * @param array $data Data to unserialize.
    850      */
    851     public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
     845     * Wakeup magic method.
     846     *
     847     * @since 6.6.0
     848     */
     849    public function __wakeup() {
    852850        throw new \LogicException( __CLASS__ . ' should never be unserialized' );
    853851    }
    854 
    855     /**
    856      * Wakeup magic method.
    857      *
    858      * @since 6.6.0
    859      */
    860     public function __wakeup() {
    861         $this->__unserialize( array() );
    862     }
    863852}
  • trunk/src/wp-includes/html-api/class-wp-html-token.php

    r60796 r60804  
    117117
    118118    /**
    119      * Unserialize magic method.
    120      *
    121      * @since 6.9.0
    122      *
    123      * @param array $data Data to unserialize.
    124      */
    125     public function __unserialize( $data ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound
    126         throw new \LogicException( __CLASS__ . ' should never be unserialized' );
    127     }
    128 
    129     /**
    130119     * Wakeup magic method.
    131120     *
     
    133122     */
    134123    public function __wakeup() {
    135         $this->__unserialize( array() );
     124        throw new \LogicException( __CLASS__ . ' should never be unserialized' );
    136125    }
    137126}
Note: See TracChangeset for help on using the changeset viewer.