class \WP_Stager_Integration\Calendar {}
class \WP_Stager_Integration\Calendar {}Description
Main class used for rendering calendars on the front-end.
Information
| File | class-calendar.php line 14 |
|---|
Methods
| Method | Description |
|---|---|
| _async_get_calendar_html() | Internal helper to render async calendars. |
| calculate_local_timestamp() | Calculates a timestamp in the current site's timezone for a date string. Takes the site's timezone setting into account. |
| calculate_offset_timestamp() | Add an ISO-8601 DateInterval spec offset to a local instant safely (DST aware). Make sure to add a minus symbol '-' before the offset to make it negative, e.g. '-P1D'. |
| calculate_timestamp_day_end() | Calculates the end timestamp of a day (23:59:59 of the day in the siteās timezone). |
| calculate_timestamp_day_start() | Calculates the start timestamp of a day (00:00:00 of the day in the siteās timezone). |
| calculate_timestamp_month_end() | Calculates the end timestamp of a given month (23:59:59 in the current site's timezone, last day of the month). |
| calculate_timestamp_month_start() | Calculates the start timestamp of a given month (00:00:00 in the current site's timezone, first day of the month). |
| calculate_timestamp_week_end() | Calculates the end timestamp of a given week (23:59:59 in the current site's timezone, last day of the week). Takes the site's start_of_week setting into account |
| calculate_timestamp_week_start() | Calculates the start timestamp of a given week (00:00:00 in the current site's timezone, first day of the week). Takes the site's start_of_week setting into account |
| calculate_timestamp_year_end() | Calculates the end timestamp of a given year (23:59:59 in the current site's timezone, last day of the year). |
| calculate_timestamp_year_start() | Calculates the start timestamp of a given year (00:00:00 in the current site's timezone, first day of the year). |
| component_cards() | Renders a cards view of events. |
| component_cards_scope() | Renders the cards-scope component (single scope wrapper and flat cards list). When $args['clip'] is true, events are clipped to the scope range ($args['start']ā$args['end']) so that custom event data supplied via the wpstagerintegration_events filter in {@see \WP_Stager_Integration\Event::parse_events()} still respects the current scope. |
| component_day() | Render a single day view of events. Extracts only the events for the given year/month/day from the provided hierarchy. If no events exist, an empty list is passed to the template. |
| component_event() | Renders a single event. |
| component_events() | Renders a list of events. |
| component_filter() | Render the filter component. |
| component_month() | Renders a full month view of events. Ensures that all days covering the month exist in the hierarchy, even if they contain no events. When clipping is enabled, only days within $args['start'] and $args['end'] are included. |
| component_no_events_message() | Renders a no events message. |
| component_week() | Render a full week view of events. Ensures that all 7 days of the week exist in the hierarchy, even if they contain no events. When clipping is enabled, only days within $args['start'] and $args['end'] are included. |
| component_year() | Renders a full year view of events. Ensures that all 12 months exist in the hierarchy, even if they contain no events. |
| format_day_label() | Formats a Unix timestamp into a text label for days in the calendar (e.g. "January 1, 2000"). Uses the site's date_format option as date format. |
| format_event_time_label() | Formats event start and end times into a text label (e.g. "9:00 am - 8:00 pm"). |
| format_month_label() | Formats a year and month number into a text label for months in the calendar (e.g. "January 2000"). |
| format_week_label() | Formats a year and week number into a text label for weeks in the calendar (e.g. "Week 12"). |
| format_year_label() | Formats a year number into a text label for years in the calendar (e.g. "2000"). |
| get_day_number() | Get a formatted day number (1-31). Takes the site's timezone setting into account. |
| get_filter_taxonomy_label() | Get the filter taxonomy labels. |
| get_filter_taxonomy_options() | Get an array of Stager Event field labels keyed by their raw field name. Returns a selection of all avaiable Stager Event fields, including only the fields that have a label defined from within the plugin. Returns an array of field => label pairs. |
| get_filter_taxonomy_terms() | Get the filter taxonomy terms. |
| get_month_number() | Get a formatted month number (1-12). Takes the site's timezone setting into account. |
| get_nav_labels() | Gets the navigation labels for specific calendar settings. |
| get_week_number() | Get a formatted week number (1-53). Takes the site's timezone setting into account. |
| get_year_number() | Get a formatted year number. Takes the site's timezone setting into account. Returns the ISO 8601 week-numbering year. This has the same value as PHP's date('Y'), except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. |
| render_all() | Renders all events. Respects the 'show_past_events' and 'show_upcoming_events' settings passed in $args. |
| render_calendar() | Renders a calendar. This method should not be called directly and is used internally by all other render_* methods. To render a calendar, use the available render_* methods. |
| render_currently_happening() | Renders currently happening events. |
| render_day() | Renders a single day. Renders the current day if either $year, $month or $day is missing. |
| render_event() | Renders a single event. |
| render_month() | Renders a single calendar month. Renders the current month if no $month and $year are passed. Otherwise: Uses the current month if no $month is passed; Uses the current year if no $year is passed. |
| render_range() | Renders a specific date range. The passed $start and $end timestamps are automatically converted to the start and end of the days that they fall on in the site's timezone (00:00:00 and 23:59:59 respectively) |
| render_week() | Renders a specific week. Renders the current week if no $week_number and $year are passed. Otherwise: Uses the current year if no $year is passed; Uses the current week if no $week_number is passed. |
| render_year() | Renders a full year. Renders the current year if no $year is passed. |
š” If you ever get stuck or have a question, please check our FAQs, our Free Integration Service, our paid Full Integration Service, or reach out to us!

Get WP Stager Integration
š Limited offer: Use code WELCOME26 to get your first month for free!

