WP_Script_Modules::print_import_map()

Prins the import mapp using a script tag with a type=”importmap” attribute.

Source

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

Changuelog

Versionen Description
6.5.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.