[wpstager_calendar]
[wpstager_calendar]Description
Registers the [wpstager_calendar] shortcode.
Any attributes added to the shortcode will be passed directly as arguments to the \WP_Stager_Integration\Calendar::render_calendar() 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="="]
Information
| File | class-shortcodes.php line 105 |
|---|---|
| Callback | WP_Stager_Integration\Shortcodes::callback_wpstager_calendar() |
| See also |
Full Code
/**
* 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' ) );💡 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!

