protected function get_local_timestamp(ActionScheduler_Action $action, DateTime $date = NULL) { $next = is_null($date) ? $action->get_schedule()->next() : $date; if (!$next) { throw new InvalidArgumentException(__('Invalid schedule. Cannot save action.', 'action-scheduler')); } $next->setTimezone($this->get_local_timezone()); return $next->format('Y-m-d H:i:s'); }
protected function schedule_next_instance(ActionScheduler_Action $action) { $next = $action->get_schedule()->next(new DateTime()); if ($next) { $this->store->save_action($action, $next); } }
public function test_null_schedule() { $action = new ActionScheduler_Action('my_hook'); $this->assertInstanceOf('ActionScheduler_NullSchedule', $action->get_schedule()); }
protected function schedule_next_instance(ActionScheduler_Action $action) { $next = $action->get_schedule()->next(as_get_datetime_object()); if ($next) { $this->store->save_action($action, $next); } }