\WP_Stager_Integration\Shortcodes::register_shortcodes(): void
\WP_Stager_Integration\Shortcodes::register_shortcodes(): voidDescription
Register all shortcodes.
Returns:
void
Information
| File | class-shortcodes.php line 33 |
|---|
Full Code
/**
* Register all shortcodes.
*
* @return void
*/
public static function register_shortcodes() {
/**
* Registers the <code>[wpstager_today]</code> shortcode.
*
* Any attributes added to the shortcode will be passed directly as arguments to the <code>\WP_Stager_Integration\Calendar::render_day()</code> method.
*
* @example
* // This will render the current day's events
* [wpstager_today]
*
* // This will hide the day label
* [wpstager_today show_label_day="false"]
*
* // This will show the day label and hide the navigation
* [wpstager_today show_label_day="true" show_nav="false"]
*
* @see \WP_Stager_Integration\Calendar::render_day() for accepted arguments.
* @see \WP_Stager_Integration\Shortcodes::callback_wpstager_today()
*/
add_shortcode( 'wpstager_today', array( __CLASS__, 'callback_wpstager_today' ) );
/**
* Registers the <code>[wpstager_ongoing]</code> shortcode.
*
* Any attributes added to the shortcode will be passed directly as arguments to the <code>\WP_Stager_Integration\Calendar::render_currently_happening()</code> method.
*
* @example
* // This will render the currently happening events
* [wpstager_ongoing]
*
* @see \WP_Stager_Integration\Calendar::render_calendar() for accepted arguments
* @see \WP_Stager_Integration\Shortcodes::callback_wpstager_ongoing()
*/
add_shortcode( 'wpstager_ongoing', array( __CLASS__, 'callback_wpstager_ongoing' ) );
/**
* Registers the <code>[wpstager_calendar]</code> shortcode.
*
* Any attributes added to the shortcode will be passed directly as arguments to the <code>\WP_Stager_Integration\Calendar::render_calendar()</code> method.
*
* @example
* // This will render the current day
* [wpstager_calendar scope="day"]
*
* // This will render the calendar for the current week
* [wpstager_calendar scope="week"]
*
* // This will render the calendar for the current month with a calendar view
* [wpstager_calendar scope="month" view="calendar"]
*
* // This will render the calendar for the current year, with the class "view-my-custom-template" added to the calendar element
* [wpstager_calendar scope="year" view="my-custom-template"]
*
* // This will render the calendar for the current week with custom navigation labels, and the week label hidden
* [wpstager_calendar scope="week" nav_label_next="Next week" nav_label_previous="Previous week" show_label_week="false"]
*
* // This will render the calendar with a filter enabled for the tags and type fields
* [wpstager_calendar enabled_filters="tags,type"]
*
* // This will render the calendar only displaying events matching a filter query.
* // By default, use | to separate values within a field, use ; to separate fields, use : to separate the field from the values.
* // For example, to render the calendar only displaying events with the tags "concert" or "theater", and the event labels "Premium" or "VIP", you can use:
* [wpstager_calendar query="tags:concert|theater; eventLabels.name:Premium|VIP; location.name:Grand Theater"]
*
* // You can also use query_value_separator, query_key_separator and query_key_value_separator to change the separators used when parsing the query string.
* // For example, to use a comma as the field separator, and a double forward slash as the value separator, and a = as the key value separator, you can use:
* [wpstager_calendar query="tags=concert//theater, eventLabels.name=Premium//VIP, location.name=Grand Theater" query_value_separator="//" query_key_separator="," query_key_value_separator="="]
*
* @see \WP_Stager_Integration\Calendar::render_calendar() for accepted arguments
* @see \WP_Stager_Integration\Shortcodes::callback_wpstager_calendar()
*/
add_shortcode( 'wpstager_calendar', array( __CLASS__, 'callback_wpstager_calendar' ) );
/**
* 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' ) );
/**
* Registers the <code>[wpstager_event_page_component]</code> shortcode for rendering event page components.
*
* Use the <code>type</code> attribute to specify which component to render. Possible values:
* <code>featured_image</code>, <code>name</code>, <code>subtitle</code>, <code>labels</code>,
* <code>meta_table</code>, <code>content</code>, <code>tickets</code>, <code>location</code>,
* <code>regular_urls</code>, <code>program</code>, <code>spotify_artists</code>, <code>gallery</code>,
* <code>videos</code>, <code>audio</code>.
*
* @example
* [wpstager_event_page_component type="featured_image"]
* [wpstager_event_page_component type="name"]
* [wpstager_event_page_component type="videos"]
* [wpstager_event_page_component type="spotify_artists"]
*
* @see \WP_Stager_Integration\Shortcodes::callback_wpstager_event_page_component()
*/
add_shortcode( 'wpstager_event_page_component', array( __CLASS__, 'callback_wpstager_event_page_component' ) );
}💡 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!

