status) { return ''; } return '' . esc_html__('Cancelled', '3task-calendar') . ' '; } /** * Settings */ private $settings; /** * Constructor */ public function __construct() { $this->settings = get_option('threecal_settings', array()); } /** * Date format from the plugin settings or WordPress. */ private function date_format() { return threecal_date_format(); } /** * Time format from the plugin settings or WordPress. */ private function time_format() { return threecal_time_format(); } /** * Render full calendar */ public function render_calendar($args = array()) { $defaults = array( 'view' => 'month', 'category_id' => 0, 'location_id' => 0, 'theme' => '', 'show_filters' => true, 'show_legend' => true, 'show_subscribe' => true, 'mobile_list' => true, 'week_starts_on' => null ); $args = wp_parse_args($args, $defaults); ThreeCal_Themes::remember_page_theme($args['theme']); $args['theme'] = ThreeCal_Themes::normalize($args['theme']); $args['view'] = in_array($args['view'], array('month', 'list'), true) ? $args['view'] : 'month'; ThreeCal_Themes::enqueue($args['theme']); // Get week start from settings if not specified if ($args['week_starts_on'] === null) { $args['week_starts_on'] = isset($this->settings['week_starts_on']) ? (int) $this->settings['week_starts_on'] : 1; } // Get current month/year. // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Calendar navigation params, sanitized with absint(). $month = isset( $_GET['cc_month'] ) ? absint( $_GET['cc_month'] ) : (int) current_time( 'n' ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Calendar navigation params, sanitized with absint(). $year = isset( $_GET['cc_year'] ) ? absint( $_GET['cc_year'] ) : (int) current_time( 'Y' ); // Validate month/year if ($month < 1 || $month > 12) { $month = (int) current_time('n'); } if ($year < 2000 || $year > 2100) { $year = (int) current_time('Y'); } // Get categories for filter/legend $categories = ThreeCal_Category::get_all(); // Generate unique ID for this calendar instance $calendar_id = 'threecal-' . wp_rand(1000, 9999); ob_start(); ?>
| get_weekday_name(($i + $week_starts_on) % 7)); ?> | |
|---|---|
|
>
$item) :
$event = $item['event'];
$show_time = !$event->all_day && $item['starts_here'];
?>
3) : ?>
+
|
' . esc_html__('No events found.', '3task-calendar') . '
'; } $categories = ThreeCal_Event::get_categories_for_events(wp_list_pluck($events, 'id')); ob_start(); ?>description ), 24 ) ); ?>
' . esc_html__('No upcoming events.', '3task-calendar') . '
'; } $categories = ThreeCal_Event::get_categories_for_events(wp_list_pluck($events, 'id')); ob_start(); ?>| get_weekday_initial(($i + $week_starts_on) % 7)); ?> | |
|---|---|
| tabindex="0" role="button" aria-label="" data-date-formatted="" data-events="" > |