Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

Products::possibly_add_manual_return_notice_script()publicWC 1.0

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

Method of the class: Products{}

No Hooks.

Return

null. Nothing (null).

Usage

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

Products::possibly_add_manual_return_notice_script() code WC 8.7.0

public function possibly_add_manual_return_notice_script( $hook ) {
	global $post;
	if ( $hook !== 'post.php' || $post->post_type !== 'product' ) {
		return;
	}

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

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

	// Clear the active task transient to only show notice once per active session.
	delete_transient( self::ACTIVE_TASK_TRANSIENT );
}