WP_Script_Modules::get_import_map()
Returns the import map array.
Method of the class: WP_Script_Modules{}
No Hooks.
Return
Array
. Array with an imports key mapping to an array of script module identifiers and their respective URLs, including the version query.
Usage
// private - for code of main (parent) class only $result = $this->get_import_map(): array;
Changelog
Since 6.5.0 | Introduced. |
WP_Script_Modules::get_import_map() WP Script Modules::get import map code WP 6.7.1
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 ); }