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.

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

Хуков нет.

Возвращает

null. Ничего.

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

$Products = new Products();
$Products->possibly_add_manual_return_notice_script( $hook );
$hook(строка) (обязательный)
Page hook.

Код Products::possibly_add_manual_return_notice_script() WC 7.1.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 );
}