/** * Render the ComicPress calendar widget. */ function comicpress_calendar_embed() { $calendar = new CalendarWidget(); $instance = array(); foreach (array('before_widget', 'after_widget', 'thumbnail', 'link', 'small', 'medium', 'large') as $field) { $instance[$field] = ''; } $calendar->widget($instance, array()); }
public function CalendarWidget() { $calendar = CalendarWidget::create($this); $controller = Controller::curr(); if ($controller->class == "Calendar_Controller" || is_subclass_of($controller, "Calendar_Controller")) { if ($controller->getView() != "default") { if ($startDate = $controller->getStartDate()) { $calendar->setOption('start', $startDate->format('Y-m-d')); } if ($endDate = $controller->getEndDate()) { $calendar->setOption('end', $endDate->format('Y-m-d')); } } } return $calendar; }