Editor: Remove unnecessary code for ensuring interactivity API dependency in block core functions

Removing old code for registering the private version of the Interactivity API pre-6.5.

Props czapla, gziolo, shailu25, cbravobernal.
Fixes #60913.


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


git-svn-id: http://core.svn.wordpress.org/trunk@57779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
gziolo 2024-06-04 07:39:10 +00:00
parent e978cba1e5
commit 6635e1b9f3
3 changed files with 1 additions and 32 deletions

View File

@ -6249,18 +6249,9 @@ function the_block_template_skip_link() {
*
* @since 6.4.0
* @deprecated 6.5.0
*
* @global WP_Scripts $wp_scripts
*/
function block_core_query_ensure_interactivity_dependency() {
_deprecated_function( __FUNCTION__, '6.5.0', 'wp_register_script_module' );
global $wp_scripts;
if (
isset( $wp_scripts->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';
}
}
/**
@ -6268,18 +6259,9 @@ function block_core_query_ensure_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';
}
}
/**
@ -6287,18 +6269,9 @@ function block_core_file_ensure_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';
}
}
/**

View File

@ -283,10 +283,6 @@ function wp_default_packages_scripts( $scripts ) {
*/
$assets = include ABSPATH . WPINC . "/assets/script-loader-packages{$suffix}.php";
// Add the private version of the Interactivity API manually.
$scripts->add( 'wp-interactivity', '/wp-includes/js/dist/interactivity.min.js' );
did_action( 'init' ) && $scripts->add_data( 'wp-interactivity', 'strategy', 'defer' );
foreach ( $assets as $file_name => $package_data ) {
$basename = str_replace( $suffix . '.js', '', basename( $file_name ) );
$handle = 'wp-' . $basename;

View File

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