WP_Script_Modules::print_enqueued_script_modules()
Prints the enqueued script modules using script tags with type=”module” attributes.
Description
If a enqueued script module has already been printed, it will not be printed again on subsequent calls to this function.
Source
File: wp-includes/class-wp-script-modules.php
public function print_enqueued_script_modules() {
foreach ( $this->get_marked_for_enqueue() as $id => $script_module ) {
if ( false === $script_module['enqueued'] ) {
// Mark it as enqueued so it doesn't get enqueued again.
$this->registered[ $id ]['enqueued'] = true;
wp_print_script_tag(
array(
'type' => 'module',
'src' => $this->get_src( $id ),
'id' => $id . '-js-module',
)
);
}
}
}
Changelog
| Version | Description |
|---|---|
| 6.5.0 | Introduced. |