Automattic\WooCommerce\Admin\Features\OnboardingTasks

Task::snooze()publicWC 1.0

Snooze the task.

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

Хуков нет.

Возвращает

true|false.

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

$Task = new Task();
$Task->snooze( $duration );
$duration(строка)
Duration to snooze. day|hour|week.
По умолчанию: 'day'

Код Task::snooze() WC 6.4.1

public function snooze( $duration = 'day' ) {
	if ( ! $this->is_snoozeable() ) {
		return false;
	}

	$snoozed                    = get_option( self::SNOOZED_OPTION, array() );
	$snoozed_until              = $this->duration_to_ms[ $duration ] + ( time() * 1000 );
	$snoozed[ $this->get_id() ] = $snoozed_until;
	$update                     = update_option( self::SNOOZED_OPTION, $snoozed );

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

	return $update;
}