Skip to main content

Shortcodes

If you prefer to use the traditional method of inserting shortcodes into your website's content, our plugin also provides shortcodes for embedding the frontend reservation widgets. Shortcodes offer a convenient way to place the widgets on specific pages, posts, or even within theme template files, or tricky places.

The main shortcode is:

[tbk-calendar]

Shortcodes can have attributes to configure the desired behaviour.

Limit services

If you want to display only some services, then you can provide the services attribute:

[tbk-calendar services="service_id_1, service_id_2"]
Where is the ID of a service?

You can take note of the ID of a service in Service > General settings

Limit providers

If you want to display only some providers, then you can provide the providers attribute:

[tbk-calendar providers="2, 3, 5"]

The number represents the ID of the provider - i.e. the WordPress user ID - that you can see in the Providers tab.

Changing the display mode

The view attribute drives the widget display mode.

Upcoming

To display a list of upcoming time slots, use the following:

[tbk-calendar view="upcoming"]

The number of displayed time slots can be specified as well. The following will display 6 upcoming time slots:

[tbk-calendar view="upcoming" displayed-events="6"]

You can also allow the loading of more slots:

[tbk-calendar view="upcoming" displayed-events="6" show-more="yes"]

In that case, the maximum number of time slots that can be loaded can be specified as well:

[tbk-calendar view="upcoming" displayed-events="6" show-more="yes" upcoming-limit="12"]

Reservations list

To display the list of reservations for the current WordPress user, use the following:

[tbk-calendar view="reservations"]

Unscheduled services

To display a list of unscheduled services, use the following:

[tbk-calendar view="unscheduled"]
info

Please note that unscheduled services are not displayed by default, as the default widget mode is calendar. In order to allow booking for unscheduled services, you must use a widget with the view attribute set as unscheduled.

Read-only

The read-only attribute makes the widget to be read-only (no bookings are allowed):

[tbk-calendar read-only="yes"]

Logged-only

The logged-only attribute makes the widget to allow booking only to registered WordPress users.

[tbk-calendar logged-only="yes"]

Combining attributes

Shortcode attributes can be combined to achieve mixed configurations:

[tbk-calendar view="upcoming" services="service_id_1" providers="3, 7" read-only="yes"]