W3cubDocs

/WordPress

WP_Script_Modules::get_import_map(): array

Returns the import map array.

Return

array Array with an imports key mapping to an array of script module identifiers and their respective URLs, including the version query.

Source

private function get_import_map(): array {
	$imports = array();
	foreach ( $this->get_dependencies( array_keys( $this->get_marked_for_enqueue() ) ) as $id => $script_module ) {
		$imports[ $id ] = $this->get_src( $id );
	}
	return array( 'imports' => $imports );
}

Changelog

Version Description
6.5.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_script_modules/get_import_map