W3cubDocs

/WordPress

WP_Script_Modules::print_enqueued_script_modules()

Prints the enqueued script modules using script tags with type=”module” attributes.

Source

public function print_enqueued_script_modules() {
	foreach ( $this->get_marked_for_enqueue() as $id => $script_module ) {
		wp_print_script_tag(
			array(
				'type' => 'module',
				'src'  => $this->get_src( $id ),
				'id'   => $id . '-js-module',
			)
		);
	}
}

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/print_enqueued_script_modules