Title: WP_Block_Patterns_Registry::__wakeup
Published: November 8, 2023
Last modified: April 28, 2025

---

# WP_Block_Patterns_Registry::__wakeup()

[ Back to top](https://developer.wordpress.org/reference/classes/wp_block_patterns_registry/__wakeup/?output_format=md#wp--skip-link--target)

## Source

    ```php
    public function __wakeup() {
    	if ( ! $this->registered_patterns ) {
    		return;
    	}
    	if ( ! is_array( $this->registered_patterns ) ) {
    		throw new UnexpectedValueException();
    	}
    	foreach ( $this->registered_patterns as $value ) {
    		if ( ! is_array( $value ) ) {
    			throw new UnexpectedValueException();
    		}
    	}
    	$this->registered_patterns_outside_init = array();
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-block-patterns-registry.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/class-wp-block-patterns-registry.php#L248)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/class-wp-block-patterns-registry.php#L248-L261)

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_block_patterns_registry%2F__wakeup%2F)
before being able to contribute a note or feedback.