wp/wp-includes/class-wp-block-type-registry.php
changeset 21 48c4eec2b7e6
parent 18 be944660c56a
--- a/wp/wp-includes/class-wp-block-type-registry.php	Thu Sep 29 08:06:27 2022 +0200
+++ b/wp/wp-includes/class-wp-block-type-registry.php	Fri Sep 05 18:40:08 2025 +0200
@@ -12,6 +12,7 @@
  *
  * @since 5.0.0
  */
+#[AllowDynamicProperties]
 final class WP_Block_Type_Registry {
 	/**
 	 * Registered block types, as `$name => $instance` pairs.
@@ -167,6 +168,20 @@
 		return isset( $this->registered_block_types[ $name ] );
 	}
 
+	public function __wakeup() {
+		if ( ! $this->registered_block_types ) {
+			return;
+		}
+		if ( ! is_array( $this->registered_block_types ) ) {
+			throw new UnexpectedValueException();
+		}
+		foreach ( $this->registered_block_types as $value ) {
+			if ( ! $value instanceof WP_Block_Type ) {
+				throw new UnexpectedValueException();
+			}
+		}
+	}
+
 	/**
 	 * Utility method to retrieve the main instance of the class.
 	 *