From 3600105163a45e62f07da3cb5607846f3e4bb4fd Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Thu, 1 Feb 2024 09:29:38 +0000 Subject: [PATCH] Editor: Add deprecated functions from interactivity core blocks. In 6.5 we are removing a couple of functions in Core blocks that were enqueuing the files needed to add that interactivity. Interactivity is handled with modules, so those functions are not needed anymore and are deprecated. Props swissspidy, cbravobernal. Fixes #60380. git-svn-id: https://develop.svn.wordpress.org/trunk@57511 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/deprecated.php | 57 ++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/src/wp-includes/deprecated.php b/src/wp-includes/deprecated.php index ec7b33f360..1fd62ae16e 100644 --- a/src/wp-includes/deprecated.php +++ b/src/wp-includes/deprecated.php @@ -6239,3 +6239,60 @@ function the_block_template_skip_link() { registered['wp-block-query-view'] ) && + ! in_array( 'wp-interactivity', $wp_scripts->registered['wp-block-query-view']->deps, true ) + ) { + $wp_scripts->registered['wp-block-query-view']->deps[] = 'wp-interactivity'; + } +} + +/** + * Ensure that the view script has the `wp-interactivity` dependency. + * + * @since 6.4.0 + * @deprecated 6.5.0 + * + * @global WP_Scripts $wp_scripts + */ +function block_core_file_ensure_interactivity_dependency() { + _deprecated_function( __FUNCTION__, '6.5.0', 'wp_register_script_module' ); + global $wp_scripts; + if ( + isset( $wp_scripts->registered['wp-block-file-view'] ) && + ! in_array( 'wp-interactivity', $wp_scripts->registered['wp-block-file-view']->deps, true ) + ) { + $wp_scripts->registered['wp-block-file-view']->deps[] = 'wp-interactivity'; + } +} + +/** + * Ensures that the view script has the `wp-interactivity` dependency. + * + * @since 6.4.0 + * @deprecated 6.5.0 + * + * @global WP_Scripts $wp_scripts + */ +function block_core_image_ensure_interactivity_dependency() { + _deprecated_function( __FUNCTION__, '6.5.0', 'wp_register_script_module' ); + global $wp_scripts; + if ( + isset( $wp_scripts->registered['wp-block-image-view'] ) && + ! in_array( 'wp-interactivity', $wp_scripts->registered['wp-block-image-view']->deps, true ) + ) { + $wp_scripts->registered['wp-block-image-view']->deps[] = 'wp-interactivity'; + } +}