block_core_image_ensure_interactivity_dependency()WP 6.4.0

Deprecated from version 6.5.0. It is no longer supported and can be removed in future releases. It is recommended to replace this function with the same one.

Ensures that the view script has the wp-interactivity dependency.

No Hooks.

Return

null. Nothing (null).

Usage

block_core_image_ensure_interactivity_dependency();

Notes

  • Global. WP_Scripts. $wp_scripts

Changelog

Since 6.4.0 Introduced.
Deprecated since 6.5.0

block_core_image_ensure_interactivity_dependency() code WP 6.5.3

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';
	}
}