MiniCart::enqueue_wc_settings()publicWC 1.0

Function to enqueue wc-settings script and dequeue it later on so when AssetDataRegistry runs, it appears enqueued- This allows the necessary data to be printed to the page.

Метод класса: MiniCart{}

Хуков нет.


null. Ничего.


$MiniCart = new MiniCart();

Код MiniCart::enqueue_wc_settings() WC 7.7.2

public function enqueue_wc_settings() {
	// Return early if another block has already enqueued `wc-settings`.
	if ( wp_script_is( 'wc-settings', 'enqueued' ) ) {
	// We are lazy-loading `wc-settings`, but we need to enqueue it here so
	// AssetDataRegistry knows it's going to load.
	wp_enqueue_script( 'wc-settings' );
	// After AssetDataRegistry function runs, we dequeue `wc-settings`.
	add_action( 'wp_print_footer_scripts', array( $this, 'dequeue_wc_settings' ), 4 );