Automattic\WooCommerce\Admin\Features\OnboardingTasks

Task::dismiss()publicWC 1.0

Dismiss the task.

{} Это метод класса: Task{}

Хуков нет.

Возвращает

true|false.

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

$Task = new Task();
$Task->dismiss();

Код Task::dismiss() WC 6.4.1

public function dismiss() {
	if ( ! $this->is_dismissable() ) {
		return false;
	}

	$dismissed   = get_option( self::DISMISSED_OPTION, array() );
	$dismissed[] = $this->get_id();
	$update      = update_option( self::DISMISSED_OPTION, array_unique( $dismissed ) );

	if ( $update ) {
		$this->record_tracks_event( 'dismiss_task', array( 'task_name' => $this->get_id() ) );
	}

	return $update;
}