# gutenberg/18.9.0/lib/interactivity-api.php

Gutenberg, version 18.9.0. 33 lines.

- Page: https://pluginprobe.com/plugins/gutenberg/18.9.0/code/lib/interactivity-api.php
- Raw: https://pluginprobe.com/plugins/gutenberg/18.9.0/raw/lib/interactivity-api.php
- Modified: 2024-04-24T19:41:50+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/gutenberg/18.9.0/code/lib/interactivity-api.php#L10-L20`.

```php
<?php
/**
 * Interactivity API functions specific for the Gutenberg editor plugin.
 *
 * @package gutenberg
 */

/**
 * Deregisters the Core Interactivity API Modules and replace them
 * with the ones from the Gutenberg plugin.
 */
function gutenberg_reregister_interactivity_script_modules() {
	$default_version = defined( 'GUTENBERG_VERSION' ) && ! SCRIPT_DEBUG ? GUTENBERG_VERSION : time();
	wp_deregister_script_module( '@wordpress/interactivity' );
	wp_deregister_script_module( '@wordpress/interactivity-router' );

	wp_register_script_module(
		'@wordpress/interactivity',
		gutenberg_url( '/build/interactivity/' . ( SCRIPT_DEBUG ? 'debug.min.js' : 'index.min.js' ) ),
		array(),
		$default_version
	);

	wp_register_script_module(
		'@wordpress/interactivity-router',
		gutenberg_url( '/build/interactivity/router.min.js' ),
		array( '@wordpress/interactivity' ),
		$default_version
	);
}

add_action( 'init', 'gutenberg_reregister_interactivity_script_modules' );

```
