Interactivity API: Cannot be used from wp-admin

Interactivity API has hooks that run on the frontend, but not in wp-admin. This means that interactivity data was not printed to the HTML and the interactivity Script Modules were not registered.

Fixes #61087.
Props jonsurrell, cbravobernal, gziolo.


Built from https://develop.svn.wordpress.org/trunk@58127


git-svn-id: http://core.svn.wordpress.org/trunk@57592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
gziolo 2024-05-10 09:13:05 +00:00
parent 1953f53b01
commit 6edbf28fec
2 changed files with 4 additions and 1 deletions

View File

@ -208,6 +208,9 @@ final class WP_Interactivity_API {
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_print_footer_scripts', array( $this, 'print_client_interactivity_data' ) );
}
/**

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.6-alpha-58126';
$wp_version = '6.6-alpha-58127';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.