Conditional Placeholders

The use of formats and placeholders in Events Manager makes formatting the look of your events very easy even for users with limited HTML knowledge. When events are output by Events Manager, it will also check for tags of {this}{/this} format within a page that accepts placeholders, which is just like HTML elements but with curly braces. If there are any conditional placeholders you feel are missing, feel free to suggest them! We’ll be regularly expanding this list, so if it’s useful to others we’ll probably add it at some point. You are also able to create your own conditional tags very easily with a little PHP knowledge and our conditional placeholder tutorial.

Event Conditional Placeholders

These placeholders can be used anywhere normal event placeholders can be used. Content will only be displayed if the condition is met, otherwise the whole placeholder will be omitted.

General

{has_image}content{/has_image}

event has a featured image.

{no_image}content{/no_image}

event does not have a featured image.

{is_recurrence}content{/is_recurrence}

event is part of a recurring set

{not_recurrence}content{/not_recurrence}

event is not part of a recurring set, meaning it is a single, normal event

{is_private}content{/is_private}

event is marked as private

{not_private}content{/not_private}

event is not marked as private

Event Times

{has_time}content{/has_time}

event is not an all-day event and does not have the same start/end times.

{no_time}content{/no_time}

event is not an all-day event and does have the same start/end times.

{all_day}content{/all_day}

event is an all-day event (regardless of start/end times).

{is_long}content{/is_long}

event lasts longer than one day (i.e. ends on different dates).

{not_long}content{/not_long}

event does not last longer than one day (i.e. same day events).

{is_past}content{/is_past}

event is in the past

{is_future}content{/is_future}

event is in the future

{is_current}content{/is_current}

event is currently happening (according to timezone of your WordPress site)

Bookings

{has_bookings}content{/has_bookings}

event has bookings enabled (regardless of space availability)

{no_bookings}content{/no_bookings}

event does not have bookings enabled (will not show for events with bookings enabled but not available for booking, e.g. if fully booked or bookings are closed)

{fully_booked}content{/fully_booked}

event has bookings enabled and spaces are not available. This does not take into account whether the user currently viewing the event can book any of those spaces (for example, there are member only tickets and a guest is viewing).

{has_spaces}content{/has_spaces}

event has bookings enabled and spaces are available. This does not take into account whether the user currently viewing the event can book any of those spaces (for example, there are member only tickets and a guest is viewing).

{bookings_open}content{/bookings_open}

event has bookings enabled and spaces are available for the current user viewing the page

{bookings_closed}content{/bookings_closed}

event has bookings enabled and spaces are not available for the current user viewing the page

{is_free}content{/is_free}

event is free, meaning there is no ticket with a price greater than 0

{not_free}content{/not_free}

event is not free, meaning there is a ticket with a price greater than 0

{is_free_now}content{/is_free_now}

event is free at the time of viewing, meaning there is no available ticket with a price greater than 0 at that specific time

{not_free_now}content{/not_free_now}

event is not free at the time of viewing, meaning there is an available ticket with a price greater than 0 at that specific time

{is_user_attendee}content{/is_user_attendee}

logged in user has a booking for the event. The booking can be of any status, if you’d like to restrict content to users with a booking of a specific status, you can add the status to the conditional placeholder with the status number (for example, pending is 0, confirmed is 1) like so: {is_user_attendee_1}content{/is_user_attendee_1}.

{not_user_attendee}content{/not_user_attendee}

logged in user does not have a booking for the event. The booking can be of any status, if you’d like to restrict content to users without a booking of a specific status, you can add the status to the conditional placeholder with the status number (for example, pending is 0, confirmed is 1) like so: {not_user_attendee_1}content{/not_user_attendee_1}.

Categories/Tags

{has_category_X}content{/has_category_X}

event has a category with a term name, id or slug of value ‘X’. Replace X with whatever category you are searching for. You can also add multiple categories, separated by commas like so, {has_category_X,Y,Z}…{/has_category_X,Y,Z}.

{no_category_X}content{/no_category_X}

event does not have a category with a term name, id or slug of value ‘X’. Replace X with whatever category you are searching for. You can also add multiple categories, separated by commas like so: {no_category_X,Y,Z}…{no_category_X,Y,Z}.

{has_tag_X}content{/has_tag_X}

event has a tag with a term name, id or slug of value ‘X’. Replace X with whatever tag you are searching for. You can also add multiple tags, separated by commas like so: {has_tag_X,Y,Z}…{has_tag_X,Y,Z}.

{no_tag_X}content{/no_tag_X}

event does not have a tag with a term name, id or slug of value ‘X’. Replace X with whatever tag you are searching for. You can also add multiple tags, separated by commas like so: {no_tag_X,Y,Z}…{no_tag_X,Y,Z}.

Locations

{has_location}content{/has_location}

event has a location.

{no_location}content{/no_location}

event does not have a location.

Other

{logged_in}content{/logged_in}

user is logged in.

{not_logged_in}content{/not_logged_in}

user is not logged in.

Nesting Conditional Placeholders

It is possible to use conditional placeholders within each other. However, by default Events Manager will only go one level deep, meaning it won’t check conditional placeholders within conditional placeholders. This is due to the extra processing required to acheive such behaviour.

In order to enable further levels of nesting, you need to add a line of PHP to your wp-config.php file:

define('EM_CONDITIONAL_RECURSIONS',2);

The example above will go 2 levels down, meaning you could nest conditional placeholders within another conditional placeholder. If you wanted to nest one inside the nested placeholder, then you need to increase that number to 3.