WP_Script_Modules::print_import_map()

Prints the import map using a script tag with a type=”importmap” attribute.


Source

File: wp-includes/class-wp-script-modules.php

	public function print_import_map() {
		$import_map = $this->get_import_map();
		if ( ! empty( $import_map['imports'] ) ) {
			wp_print_inline_script_tag(
				wp_json_encode( $import_map, JSON_HEX_TAG | JSON_HEX_AMP ),
				array(
					'type' => 'importmap',
					'id'   => 'wp-importmap',
				)
			);
		}
	}


Changelog

Changelog
Version Description
6.5.0 Introduced.