ActionScheduler_ListTable::get_recurrence()protectedWC 1.0

Returns the recurrence of an action or 'Non-repeating'. The output is human readable.

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

Хуков нет.

Возвращает

Строку.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_recurrence( $action );
$action(ActionScheduler_Action) (обязательный)
-

Код ActionScheduler_ListTable::get_recurrence() WC 8.7.0

protected function get_recurrence( $action ) {
	$schedule = $action->get_schedule();
	if ( $schedule->is_recurring() && method_exists( $schedule, 'get_recurrence' ) ) {
		$recurrence = $schedule->get_recurrence();

		if ( is_numeric( $recurrence ) ) {
			/* translators: %s: time interval */
			return sprintf( __( 'Every %s', 'woocommerce' ), self::human_interval( $recurrence ) );
		} else {
			return $recurrence;
		}
	}

	return __( 'Non-repeating', 'woocommerce' );
}