W3cubDocs

/WordPress

WP_Theme::__wakeup()

Perform reinitialization tasks.

Description

Prevents a callback from being injected during unserialization of an object.

Source

public function __wakeup() {
	if ( $this->parent && ! $this->parent instanceof self ) {
		throw new UnexpectedValueException();
	}
	if ( $this->headers && ! is_array( $this->headers ) ) {
		throw new UnexpectedValueException();
	}
	foreach ( $this->headers as $value ) {
		if ( ! is_string( $value ) ) {
			throw new UnexpectedValueException();
		}
	}
	$this->headers_sanitized = array();
}

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_theme/__wakeup