# gutenberg/17.2.1/lib/experimental/interactivity-api/modules.php

Gutenberg, version 17.2.1. 34 lines.

- Page: https://pluginprobe.com/plugins/gutenberg/17.2.1/code/lib/experimental/interactivity-api/modules.php
- Raw: https://pluginprobe.com/plugins/gutenberg/17.2.1/raw/lib/experimental/interactivity-api/modules.php
- Modified: 2023-12-06T20:38:26+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/17.2.1/code/lib/experimental/interactivity-api/modules.php#L10-L20`.

```php
<?php
/**
 * Interactive modules.
 *
 * @package Gutenberg
 * @subpackage Interactivity API
 */

/**
 * Register the `@wordpress/interactivity` module.
 */
function gutenberg_register_interactivity_module() {
	gutenberg_register_module(
		'@wordpress/interactivity',
		gutenberg_url( '/build/interactivity/index.min.js' ),
		array(),
		defined( 'GUTENBERG_VERSION' ) ? GUTENBERG_VERSION : get_bloginfo( 'version' )
	);

	// TODO: Replace with a simpler version that only provides support for import maps.
	// TODO: Load only if the browser doesn't support import maps (https://github.com/guybedford/es-module-shims/issues/371).
	wp_enqueue_script(
		'es-module-shims',
		gutenberg_url( '/build/modules/importmap-polyfill.min.js' ),
		array(),
		null,
		array(
			'strategy' => 'defer',
		)
	);
}

add_action( 'wp_enqueue_scripts', 'gutenberg_register_interactivity_module' );

```
