\WP_Stager_Integration\Calendar::component_cards(array[] $events, array $args = array()): void

Description

Renders a cards view of events.

Parameters:

ParameterTypeDescription
$events array[] Flat array of raw Stager event arrays
$args array (Optional) Additional arguments to pass to the component template.

Returns:

void

Information

Fileclass-calendar.php line 1609

Full Code

/**
 * Renders a cards view of events.
 *
 * @param array[] $events         Flat array of raw Stager event arrays
 * @param array   $args           (Optional) Additional arguments to pass to the component template.
 *
 * @return void
 */
public static function component_cards( $events, $args = array() ) {

    // Type casting
    $events = (array) $events;
    $args   = (array) $args;

    // Set events argument
    $args[ 'events' ] = $events;

    self::render_calendar_component( 'card-list', $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!