ActionScheduler_ListTable::get_recurrence()protectedWC 1.0

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

Method of the class: ActionScheduler_ListTable{}

No Hooks.

Return

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_recurrence( $action );
$action(ActionScheduler_Action) (required)
-

ActionScheduler_ListTable::get_recurrence() code WC 8.6.1

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' );
}