From aa5f1d0d31d69500aaee4643fc7bd3500779c9ca Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Fri, 26 Apr 2024 13:56:31 +0200 Subject: [PATCH 1/2] Add Interactivity API hooks to admin_ --- .../interactivity-api/class-wp-interactivity-api.php | 3 +++ 1 file changed, 3 insertions(+) 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 3db539aae6992..d1ec894698b9f 100644 --- a/src/wp-includes/interactivity-api/class-wp-interactivity-api.php +++ b/src/wp-includes/interactivity-api/class-wp-interactivity-api.php @@ -208,6 +208,9 @@ public function register_script_modules() { public function add_hooks() { add_action( 'wp_enqueue_scripts', array( $this, 'register_script_modules' ) ); add_action( 'wp_footer', array( $this, 'print_client_interactivity_data' ) ); + + add_action( 'admin_enqueue_scripts', array( $this, 'register_script_modules' ) ); + add_action( 'admin_footer', array( $this, 'print_client_interactivity_data' ) ); } /** From 9aad1c971dd7b3d2a510e3e1e97008513ad82cae Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Wed, 8 May 2024 17:29:34 +0200 Subject: [PATCH 2/2] Use admin_print_footer_scripts to print interactivity data --- .../interactivity-api/class-wp-interactivity-api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 d1ec894698b9f..cc894c7e3018d 100644 --- a/src/wp-includes/interactivity-api/class-wp-interactivity-api.php +++ b/src/wp-includes/interactivity-api/class-wp-interactivity-api.php @@ -210,7 +210,7 @@ public function add_hooks() { add_action( 'wp_footer', array( $this, 'print_client_interactivity_data' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'register_script_modules' ) ); - add_action( 'admin_footer', array( $this, 'print_client_interactivity_data' ) ); + add_action( 'admin_print_footer_scripts', array( $this, 'print_client_interactivity_data' ) ); } /**