ActionScheduler_ListTable::get_recurrence
Returns the recurrence of an action or 'Non-repeating'. The output is human readable.
Method of the class: ActionScheduler_ListTable{}
No Hooks.
Returns
String.
Usage
// protected - for code of main (parent) or child class $result = $this->get_recurrence( $action );
- $action(ActionScheduler_Action) (required)
- Action object.
ActionScheduler_ListTable::get_recurrence() ActionScheduler ListTable::get recurrence code WC 10.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' );
}