From de393a7f11908fcf6653d07498ba92cf82bfb4c4 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Wed, 20 Nov 2024 15:27:04 +0000 Subject: [PATCH] Interactivity API: Remove redundant server state from Interactivity Router. Remove the workaround for a bug that was fixed in https://github.com/WordPress/gutenberg/pull/66183. Previously, if the store was not initialized with a minimal navigation object, the interactivity-router script module would error. Reviewed by desrosj. Merges [59416] to the 6.7 branch. Props jonsurrell, czapla, gziolo. Fixes #62465. git-svn-id: https://develop.svn.wordpress.org/branches/6.7@59436 602fd350-edb4-49c9-b593-d223f7449a82 --- .../class-wp-interactivity-api.php | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/wp-includes/interactivity-api/class-wp-interactivity-api.php b/src/wp-includes/interactivity-api/class-wp-interactivity-api.php index f71684599f22e..f6764736f9e8a 100644 --- a/src/wp-includes/interactivity-api/class-wp-interactivity-api.php +++ b/src/wp-includes/interactivity-api/class-wp-interactivity-api.php @@ -1090,19 +1090,6 @@ private function data_wp_router_region_processor( WP_Interactivity_API_Directive if ( 'enter' === $mode && ! $this->has_processed_router_region ) { $this->has_processed_router_region = true; - /* - * Initialize the `core/router` store. - * If the store is not initialized like this with minimal - * navigation object, the interactivity-router script module - * errors. - */ - $this->state( - 'core/router', - array( - 'navigation' => new stdClass(), - ) - ); - // Enqueues as an inline style. wp_register_style( 'wp-interactivity-router-animations', false ); wp_add_inline_style( 'wp-interactivity-router-animations', $this->get_router_animation_styles() );