Automattic\WooCommerce\Internal\Admin

WCAdminAssets::output_header_preload_tags()privateWC 1.0

Output preload link tags for all enqueued stylesheets and scripts.

See: https://macarthur.me/posts/preloading-javascript-in-wordpress

Method of the class: WCAdminAssets{}

No Hooks.

Return

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->output_header_preload_tags();

WCAdminAssets::output_header_preload_tags() code WC 8.7.0

private function output_header_preload_tags() {
	$wc_admin_scripts = array(
		WC_ADMIN_APP,
		'wc-components',
	);

	$wc_admin_styles = array(
		WC_ADMIN_APP,
		'wc-components',
		'wc-material-icons',
	);

	// Preload styles.
	$this->output_header_preload_tags_for_type( 'style', $wc_admin_styles );

	// Preload scripts.
	$this->output_header_preload_tags_for_type( 'script', $wc_admin_scripts );
}