Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

Products::possibly_add_import_return_notice_script()publicWC 1.0

Adds a return to task list notice when completing the import product task.

Method of the class: Products{}

No Hooks.

Return

null. Nothing.

Usage

$Products = new Products();
$Products->possibly_add_import_return_notice_script( $hook );
$hook(string) (required)
Page hook.

Products::possibly_add_import_return_notice_script() code WC 7.1.1

public function possibly_add_import_return_notice_script( $hook ) {
	$step = isset( $_GET['step'] ) ? $_GET['step'] : ''; // phpcs:ignore csrf ok, sanitization ok.

	if ( $hook !== 'product_page_product_importer' || $step !== 'done' ) {
		return;
	}

	if ( ! $this->is_active() || $this->is_complete() ) {
		return;
	}

	WCAdminAssets::register_script( 'wp-admin-scripts', 'onboarding-product-import-notice', true );
}