Automattic\WooCommerce\Admin

PluginsHelper::maybe_enqueue_scripts_for_connect_notice │ public static │ WC 1.0

Enqueue scripts for connect notice in WooCommerce settings page.

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

Хуков нет.

Возвращает

void. Ничего (null).

Использование

$result = PluginsHelper::maybe_enqueue_scripts_for_connect_notice();

Код PluginsHelper::maybe_enqueue_scripts_for_connect_notice() WC 11.3.0

public static function maybe_enqueue_scripts_for_connect_notice() {
	if ( 'woocommerce_page_wc-settings' !== get_current_screen()->id ) {
		return;
	}

	$notice_type = WC_Helper_Updater::get_woo_connect_notice_type();

	if ( in_array( $notice_type, array( 'none', 'long' ), true ) ) {
		return;
	}

	WCAdminAssets::register_script( 'wp-admin-scripts', 'woo-connect-notice' );
	wp_enqueue_script( 'woo-connect-notice' );
}