\WP_Stager_Integration\Component::render_ticket_shop_widget_event(array $args = array()): void

Description

Render the Stager event widget component.

Example:

// Render the "Advanced" event widget
\WP_Stager_Integration\Component::render_ticket_shop_widget_event( array(
'widget_options' => array(
'integrationType' => 'advanced',
),
) );

// Render the "Basic" widget with "single-event" initial load page
\WP_Stager_Integration\Component::render_ticket_shop_widget_event( array(
'widget_options' => array(
'integrationType' => 'basic',
),
) );

Parameters:

ParameterTypeDescription
$args['widget_options'] array {
$args['integrationType'] string The integration type ('basic', 'advanced'). Defaults to 'advanced'.

Returns:

void

Information

Fileclass-component.php line 674

Full Code

/**
 * Render the Stager event widget component.
 *
 * @param array $args {
 *     (Optional) Arguments to pass to the widget.
 *
 *     @type array $widget_options {
 *         @type string $integrationType The integration type ('basic', 'advanced'). Defaults to 'advanced'.
 *     }

 * }
 *
 * @example
 * // Render the "Advanced" event widget
 * \WP_Stager_Integration\Component::render_ticket_shop_widget_event( array(
 *     'widget_options' => array(
 *         'integrationType' => 'advanced',
 *     ),
 * ) );
 *
 * // Render the "Basic" widget with "single-event" initial load page
 * \WP_Stager_Integration\Component::render_ticket_shop_widget_event( array(
 *     'widget_options' => array(
 *         'integrationType' => 'basic',
 *     ),
 * ) );
 *
 * @return void
 */
public static function render_ticket_shop_widget_event( $args = array() ) {

    // Get data
    $has_feature_ticket_shops = (bool) Options::has_ticket_shops();

    // Bail if feature is not enabled
    if ( ! $has_feature_ticket_shops ) {
        return;
    }

    // Render the component
    self::render( 'event', 'template-parts/shop-widgets', $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!