\WP_Stager_Integration\Calendar::component_day(int $year, int $month, int $day, array $all_events = null, array $args = array()): void
\WP_Stager_Integration\Calendar::component_day(int $year, int $month, int $day, array $all_events = null, array $args = array()): voidDescription
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.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$year | int | The year (e.g. 2025). |
$month | int | The month number (1ā12). |
$day | int | The day number (1ā31). |
$all_events | array | Nested hierarchy of events (year ā month ā day). |
$args | array | (Optional) Additional arguments to pass to the component template. |
Returns:
void
Information
| File | class-calendar.php line 1923 |
|---|
Full Code
/**
* 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.
*
* @param int $year The year (e.g. 2025).
* @param int $month The month number (1ā12).
* @param int $day The day number (1ā31).
* @param array $all_events Nested hierarchy of events (year ā month ā day).
* @param array $args (Optional) Additional arguments to pass to the component template.
*
* @return void
*/
public static function component_day( $year, $month, $day, $all_events = null, $args = array() ) {
// Type casting
$year = (int) $year;
$month = (int) $month;
$day = (int) $day;
$all_events = (array) $all_events;
$args = (array) $args;
// Extract only this day's events
$events = (array) ($all_events[ $year ][ $month ][ $day ] ?? array());
self::render_calendar_component( 'day', array(
'year' => $year,
'month' => $month,
'day' => $day,
'events' => $events,
'component_args' => $args,
) );
}š” 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!

