[wpstager_ticket_shop_widget]

Description

Registers the [wpstager_ticket_shop_widget] shortcode.

Any attributes added to the shortcode (except 'type') will be passed as arguments to the Stager widget initialization functions. Since shortcodes attributes are always converted to lowercase, and the Stager widget initialization functions expect camelCase options, any snake_case attributes will be converted to camelCase.

Example:

// This will render the (advanced) basket widget (which is the default)
[wpstager_ticket_shop_widget] // or:
[wpstager_ticket_shop_widget type="basket"]

// This will render the (advanced) event widget.
// On single event pages, the event ID is automatically retrieved from the currently viewed event.
[wpstager_ticket_shop_widget type="event"]

// This will render the order widget
[wpstager_ticket_shop_widget type="order"]

// This will render the event widget for an event with the event ID 12345
[wpstager_ticket_shop_widget type="event" event_id="12345"]

// This will render the basket widget for a ticket shop with the shop ID 12345
[wpstager_ticket_shop_widget type="basket" shop_id="12345"]

// This will render the "basic" widget, embedded, and loading the events page
[wpstager_ticket_shop_widget type="basic" render_type="embedded" initial_load_page="events"]

// This will render the "basic" widget, full screen, and loading a specific single event, with the cookie banner disabled.
// On single event pages, the event ID is automatically retrieved from the currently viewed event, so it doesn't need to be provided.
[wpstager_ticket_shop_widget type="basic" render_type="fullscreen" initial_load_page="single-event" cookie_banner_enabled="false"]

Full Code

/**
 * Registers the <code>[wpstager_ticket_shop_widget]</code> shortcode.
 *
 * Any attributes added to the shortcode (except 'type') will be passed as arguments to the Stager widget initialization functions.
 * Since shortcodes attributes are always converted to lowercase, and the Stager widget initialization functions expect camelCase options, any snake_case attributes will be converted to camelCase.
 *
 * @example
 * // This will render the (advanced) basket widget (which is the default)
 * [wpstager_ticket_shop_widget] // or:
 * [wpstager_ticket_shop_widget type="basket"]
 *
 * // This will render the (advanced) event widget.
 * // On single event pages, the event ID is automatically retrieved from the currently viewed event.
 * [wpstager_ticket_shop_widget type="event"]
 *
 * // This will render the order widget
 * [wpstager_ticket_shop_widget type="order"]
 *
 * // This will render the event widget for an event with the event ID 12345
 * [wpstager_ticket_shop_widget type="event" event_id="12345"]
 *
 * // This will render the basket widget for a ticket shop with the shop ID 12345
 * [wpstager_ticket_shop_widget type="basket" shop_id="12345"]
 *
 * // This will render the "basic" widget, embedded, and loading the events page
 * [wpstager_ticket_shop_widget type="basic" render_type="embedded" initial_load_page="events"]
 *
 * // This will render the "basic" widget, full screen, and loading a specific single event, with the cookie banner disabled.
 * // On single event pages, the event ID is automatically retrieved from the currently viewed event, so it doesn't need to be provided.
 * [wpstager_ticket_shop_widget type="basic" render_type="fullscreen" initial_load_page="single-event" cookie_banner_enabled="false"]
 *
 * @see \WP_Stager_Integration\Shortcodes::callback_wpstager_ticket_shop_widget()
 * @see \WP_Stager_Integration\Component::render_ticket_shop_widget_event()
 * @see \WP_Stager_Integration\Component::render_ticket_shop_widget_basket()
 * @see \WP_Stager_Integration\Component::render_ticket_shop_widget_order()
 */
add_shortcode( 'wpstager_ticket_shop_widget', array( __CLASS__, 'callback_wpstager_ticket_shop_widget' ) );

💡 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!