Title: Conditional shortcode info
Last modified: September 24, 2019

---

# Conditional shortcode info

 *  Resolved [blanch80](https://wordpress.org/support/users/blanch80/)
 * (@blanch80)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/conditional-shortcode-info/)
 * Hi Franky,
 * I’m hoping you can help with the conditional shortcodes as I can’t get one part
   working.
 * I have the below, which works in that it shows the text if the all main spaces
   are booked but there are spaces on the waiting list.
 * [eme_if tag=’#_WAITING_LIST_ACTIVATED’ value=’1′, eme_if2 tag=’#_IS_REGISTERED’
   value=’0′]
    <b>PLEASE NOTE THIS EVENT IS CURRENTLY FULL. <br /> SENDING THE BOOKING
   DETAILS BELOW WILL ADD YOU TO THE WAITING LIST, IT WILL NOT BOOK YOU A PLACE.
   <br /> IF A PLACE BECOMES AVAILABLE WE WILL CONTACT YOU VIA EMAIL.</b><br /> [/
   eme_if]
 * I’m trying to do the same around text to say that if someone has booked a place
   they can cancel using the below booking form, the code below works fine.
 * [eme_if tag=’#_IS_REGISTERED’ value=’1′, eme_if2 tag=’#_WAITING_LIST_ACTIVATED’
   value=’1′]
    <hr> <b>You already have a place booked on this event. To cancel 
   your place please use the form below. [/eme_if]
 * Then I’m also trying to add conditional text for people who are on the waiting
   list to say they are on the waiting list, and if they want to cancel their place
   on the waiting list to use the form below, code:
 * [eme_if tag=’#_IS_REGISTERED’ value=’0′, eme_if2 tag=’#_WAITING_LIST_ACTIVATED’
   value=’1′]
    <hr> <b>You are currently on the waiting list for this event. To 
   cancel your place please use the form below. [/eme_if]
 * This code however shows either way, i think because although they don’t have 
   a place booked they are on the waiting list so #_IS_REGISTERED is true, even 
   though they don’t have a actual place. Is this correct?
 * I’m hoping you can help, hope I’ve explained things properly. Just let me know
   if you need things clearing up.
 * Thanks,
    David.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fconditional-shortcode-info%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/conditional-shortcode-info/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/conditional-shortcode-info/page/2/?output_format=md)

 *  Thread Starter [blanch80](https://wordpress.org/support/users/blanch80/)
 * (@blanch80)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/conditional-shortcode-info/#post-11962945)
 * My problem is that the following code is not presenting the booking form with‘
   you’re going to be on a waiting list’ message, it just shows the same form with
   the send your booking button even though there are no spaces left.
 * It does send the pending email rather than the booked email, but I know what 
   people are like reading emails and if they’ve clicked send your booking they 
   might still turn up even if they’re only on the waiting list.
 * <h1>#_EVENTNAME</h1>
    <br /> <b>Date/Time</b>: #_STARTDATE{l}, #_STARTDATE – #
   _STARTTIME – #_ENDTIME <br /> <br /> <b>Location</b>: [#_LOCATIONNAME](https://wordpress.org/support/topic/conditional-shortcode-info/?output_format=md#_LOCATIONPAGEURL)
   <br /> <br /> <b>Available Spaces</b>: #_AVAILABLESEATS <br /> <br /> <b>Contact
   Details</b>: #_AUTHORNAME: [#_AUTHOREMAIL](https://wordpress.org/support/topic/conditional-shortcode-info/?output_format=md#_AUTHOREMAIL?Subject=QUERY:%20#_EVENTNAME,%20#_LOCATIONNAME,%20#_STARTDATE)
   <br /> <br /> <b>Description</b>#_NOTES #_ADDBOOKINGFORM #_REMOVEBOOKINGFORM_IF_REGISTERED
   <br /><br /><br />#_MAP
 *  Plugin Author [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/conditional-shortcode-info/#post-11963069)
 * (please use the “code” button to show code)
    Nested if-statements don’t work 
   like you have them. So this is not correct and will not work as expected:
 *     ```
       [eme_if tag=’#_IS_REGISTERED’ value=’1′, eme_if2 tag=’#_WAITING_LIST_ACTIVATED’ value=’1′]
       <hr>
       <b>You are currently on the waiting list for this event. To cancel your place please use the form below.
       [/eme_if]
       ```
   
 * This is the way to use nested conditional tags (but it won’t work, since #_WAITING_LIST_ACTIVATED
   won’t do what you want) :
 *     ```
       [eme_if tag='#_IS_REGISTERED' value='1']
       [eme_if2 tag='#_WAITING_LIST_ACTIVATED' value='1']
       <hr>
       <b>You are currently on the waiting list for this event. To cancel your place please use the form below.
       [/eme_if2]
       [/eme_if]
       ```
   
 * But: #_WAITING_LIST_ACTIVATED is to be used to show that new bookings will be
   on the waiting list, not for a specific booking itself. See [https://www.e-dynamics.be/wordpress/waiting-list/](https://www.e-dynamics.be/wordpress/waiting-list/)
   
   You probaly want #_ON_WAITINGLIST:
 *     ```
       [eme_if tag='#_IS_REGISTERED' value='1']
       [eme_if2 tag='#_ON_WAITINGLIST' value='1']
       <hr>
       <b>You are currently on the waiting list for this event. To cancel your place please use the form below.
       [/eme_if2]
       [/eme_if]
       ```
   
 * And I think this will work just fine too then:
 *     ```
       [eme_if tag='#_ON_WAITINGLIST' value='1']
       <hr>
       <b>You are currently on the waiting list for this event. To cancel your place please use the form below.
       [/eme_if]
       ```
   
 *  Thread Starter [blanch80](https://wordpress.org/support/users/blanch80/)
 * (@blanch80)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/conditional-shortcode-info/#post-11963455)
 * Thanks for this Franky.
 * I’ve changed it up so it looks like
 *     ```
       [eme_if tag='#_IS_REGISTERED' value ='0']
   
       <table class='eme-rsvp-form'>
       <tr><th scope='row'>First Name*:</th><td>#REQ_FIRSTNAME</td></tr>#_SEATS 
       <tr><th scope='row'>Last Name*:</th><td>#_LASTNAME</td></tr>
       <tr><th scope='row'>E-Mail*:</th><td>#_EMAIL</td></tr>
       </table>
   
       #_SUBMIT
   
       [/eme_if]
   
       [eme_if tag='#_IS_REGISTERED' value ='0']
       [eme_if2 tag='#_WAITING_LIST_ACTIVATED' value='1']
   
       <b>There are currently no spaces available on this event. Submitting the form below will add you to the waiting list.</b>
   
       <table class='eme-rsvp-form'>
       <tr><th scope='row'>First Name*:</th><td>#REQ_FIRSTNAME</td></tr>#_SEATS 
       <tr><th scope='row'>Last Name*:</th><td>#_LASTNAME</td></tr>
       <tr><th scope='row'>E-Mail*:</th><td>#_EMAIL</td></tr>
       </table>
   
       #_SUBMIT{Request place on waiting list}
   
       [/eme_if2]
       [/eme_if]
       ```
   
 * For page loads with no waiting list it works fine, can book and cancel bookings
   no problem.
 * When I load the event with no spaces however it shows both booking forms with
   the two different submit buttons, which I’d expect from how I’ve used the shortcodes.
 * I then added the second eme_if2 to the code to hide the first booking form if#
   _WAITING_LIST_ACTIVATED is 0 / false but it hides the booking form completely
   even though both conditions are true.
 *     ```
       [eme_if tag='#_IS_REGISTERED' value ='0']
       [eme_if2 tag='#_WAITING_LIST_ACTIVATED' value ='0']
   
       <table class='eme-rsvp-form'>
       <tr><th scope='row'>First Name*:</th><td>#REQ_FIRSTNAME</td></tr>#_SEATS 
       <tr><th scope='row'>Last Name*:</th><td>#_LASTNAME</td></tr>
       <tr><th scope='row'>E-Mail*:</th><td>#_EMAIL</td></tr>
       </table>
   
       #_SUBMIT
   
       [/eme_if2]
       [/eme_if]
       ```
   
 * Ideally the first booking form is hidden when waiting list is active, I’m only
   doing this so I can have different text in the submit button to make it clear
   what users are doing.
 * Link is: [https://test.learning.necsu.nhs.uk/events/6-nations-italy-vs-ireland/](https://test.learning.necsu.nhs.uk/events/6-nations-italy-vs-ireland/)
 * Any advice on this one please?
 * Thanks,
    David.
 *  Thread Starter [blanch80](https://wordpress.org/support/users/blanch80/)
 * (@blanch80)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/conditional-shortcode-info/#post-11963478)
 * The whole of the 2nd lot of code is:
 *     ```
       [eme_if tag='#_IS_REGISTERED' value ='0']
       [eme_if2 tag='#_WAITING_LIST_ACTIVATED' value ='0']
   
       <table class='eme-rsvp-form'>
       <tr><th scope='row'>First Name*:</th><td>#REQ_FIRSTNAME</td></tr>#_SEATS 
       <tr><th scope='row'>Last Name*:</th><td>#_LASTNAME</td></tr>
       <tr><th scope='row'>E-Mail*:</th><td>#_EMAIL</td></tr>
       </table>
   
       #_SUBMIT
   
       [/eme_if2]
       [/eme_if]
   
       [eme_if tag='#_IS_REGISTERED' value ='0']
       [eme_if2 tag='#_WAITING_LIST_ACTIVATED' value='1']
   
       <b>There are currently no spaces available on this event. Submitting the form below will add you to the waiting list.</b>
   
       <table class='eme-rsvp-form'>
       <tr><th scope='row'>First Name*:</th><td>#REQ_FIRSTNAME</td></tr>#_SEATS 
       <tr><th scope='row'>Last Name*:</th><td>#_LASTNAME</td></tr>
       <tr><th scope='row'>E-Mail*:</th><td>#_EMAIL</td></tr>
       </table>
   
       #_SUBMIT{Request place on waiting list}
   
       [/eme_if2]
       [/eme_if]
       ```
   
 *  Plugin Author [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/conditional-shortcode-info/#post-11963558)
 * If you really want to only allow registrations if not already done, why not just
   use
    #_ADDBOOKINGFORM_IF_NOT_REGISTERED in your single event format (that shows
   the form only if not already registered) And then just use
 *     ```
       [eme_if tag='#_WAITING_LIST_ACTIVATED' value='1']
       blahblah
       [/eme_if]
       ```
   
 * to show extra text to tell people their request will be on a waiting list.
    But
   normally EME just tells you “This booking will be put on the waiting list” by
   default. So I’m a bit unsure of what you want to achieve extra here.
 *  Thread Starter [blanch80](https://wordpress.org/support/users/blanch80/)
 * (@blanch80)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/conditional-shortcode-info/#post-11963572)
 * I think that might be the problem, as it doesn’t seem to be showing the message
   about putting the booking on a waiting list?
 * People must be registered in order to book onto an event, I’ve got that configured
   in the settings.
 * I’m using the following code in the Default single event format
 *     ```
       <h1>#_EVENTNAME</h1>
       <br />
       <b>Date/Time</b>: #_STARTDATE{l}, #_STARTDATE - #_STARTTIME -  #_ENDTIME 
       <br />
       <br />
       <b>Location</b>: <a href="#_LOCATIONPAGEURL">#_LOCATIONNAME</a>
       <br />
       <br />
       <b>Available Spaces</b>: #_AVAILABLESEATS
       <br />
       <br />
       <b>Contact Details</b>: #_AUTHORNAME: <a href="mailto:#_AUTHOREMAIL?Subject=QUERY:%20#_EVENTNAME,%20#_LOCATIONNAME,%20#_STARTDATE">#_AUTHOREMAIL</a>
       <br />
       <br />
       <b>Description</b>#_NOTES
       <br />
       #_ADDBOOKINGFORM_IF_NOT_REGISTERED
       #_REMOVEBOOKINGFORM_IF_REGISTERED<br /><br /><br />#_MAP
       ```
   
 * The code in the post above is in a template for the booking form.
    -  This reply was modified 6 years, 8 months ago by [blanch80](https://wordpress.org/support/users/blanch80/).
 *  Plugin Author [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/conditional-shortcode-info/#post-11963595)
 * That template format is just fine. So normally, if waiting list seats are activated
   EME should tell you about this in if the regular limit is reached. I’ll test 
   this out at home again to be sure 🙂
 *  Thread Starter [blanch80](https://wordpress.org/support/users/blanch80/)
 * (@blanch80)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/conditional-shortcode-info/#post-11963639)
 * Thanks Franky.
 * There isn’t an option to enable waiting lists is there?
 * The way I’ve done it is have 2 Seats on the event then have 1 waitinglist seat,
   putting 1 in the max number of seats to book and 1 in the min number of seats
   to book.
 *  Plugin Author [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/conditional-shortcode-info/#post-11963700)
 * There is. See the RSVP options per event, you can/must enter the number of seats
   in the option “Waitinglist seats”. The min/max number of seats to book are so
   people are required to book at least x seats and at most y seats per booking.
   
   That number will be deducted from the total number of seats, see [https://www.e-dynamics.be/wordpress/waiting-list/](https://www.e-dynamics.be/wordpress/waiting-list/)
 *  Thread Starter [blanch80](https://wordpress.org/support/users/blanch80/)
 * (@blanch80)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/conditional-shortcode-info/#post-11963711)
 * Ah, I’ve done that. I was just wondering if there was an option elsewhere I hadn’t
   checked to make it work.
 * I’ll wait to hear from you after your testing tonight.
 * If everything goes OK I might have to remove the plugin and data and reinstall
   to see if that works.
 *  Plugin Author [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/conditional-shortcode-info/#post-11964639)
 * Normally, next to the number of seats you can book, you’ll see the warning that
   the booking will be on the waiting list. Even if you have the minimum and max
   set to 1, the warning will still show (just tested it here).
    Maybe in your case
   the warning is hidden? Could you put up a demo?
 *  Thread Starter [blanch80](https://wordpress.org/support/users/blanch80/)
 * (@blanch80)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/conditional-shortcode-info/#post-11966542)
 * It’s weird…
 * I’ve created a new event and it works on that one, basic code with no [eme_if]
   tags and the ‘This booking will be put on the waiting list’ text appears.
 * The event i was testing on yesterday wasn’t doing this. I’ve deleted that one
   and tried creating a couple more new events and it works each time.
 * I guess my question now is how can I edit that text? I’ve looked in the options
   but it doesn’t seem to be listed (I’m looking on the RSVP tab) as I’d like to
   add some extra text and make it bold.
 * My booking form format is:
 *     ```
       <table class='eme-rsvp-form'>
           <tr><th scope='row'>First Name*:</th><td>#REQ_FIRSTNAME</td></tr>#_SEATS 
           <tr><th scope='row'>Last Name*:</th><td>#_LASTNAME</td></tr>
           <tr><th scope='row'>E-Mail*:</th><td>#_EMAIL</td></tr>
       </table>
       #_SUBMIT
       ```
   
 * I’ve changed this to try to have the SUBMIT button show different text if it’s
   a waiting list booking rather than a standard one…
 *     ```
       <table class='eme-rsvp-form'>
           <tr><th scope='row'>First Name*:</th><td>#REQ_FIRSTNAME</td></tr>#_SEATS 
           <tr><th scope='row'>Last Name*:</th><td>#_LASTNAME</td></tr>
           <tr><th scope='row'>E-Mail*:</th><td>#_EMAIL</td></tr>
       </table>
       [eme_if tag='#_WAITING_LIST_ACTIVATED' value='0']
       #_SUBMIT
       [/eme_if]
       [eme_if tag='#_WAITING_LIST_ACTIVATED' value='1']
       #_SUBMIT{Request to be place on the waiting list}
       [/eme_if]
       ```
   
 * With this code the Submit your booking button can’t be seen when there are spaces
   available to book.
 * On the event page: [https://test.learning.necsu.nhs.uk/events/test-event-2/](https://test.learning.necsu.nhs.uk/events/test-event-2/)
 * When the event loads with only waiting list seats available the button with the
   custom text shows OK.
 * If I remove the eme_if code around
 *     ```
       [eme_if tag='#_WAITING_LIST_ACTIVATED' value='0']
       #_SUBMIT
       [/eme_if]
       ```
   
 * The the button shows when there are spaces available, but they both show if waiting
   list places are available.
 * That’s how it stands now. If you have the time I could send you credentials for
   the site to take a look if that’s something you could do?
 *  Plugin Author [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/conditional-shortcode-info/#post-11966850)
 * No, there is a bug in eme_events.php: if the waiting list is not activated, the
   returned value is currently empty (not 0).
    It’s a simple change in eme_events.
   php. Change line 1568 and following to (adding the “else”-part):
 *     ```
       	 if ($waitinglist_seats>0 && $avail_seats<=$waitinglist_seats && !eme_is_multi($linked_event['event_seats'])) {
       		 $replacement=1;
       	 } else {
       		 $replacement=0;
       	 }
       ```
   
 *  Thread Starter [blanch80](https://wordpress.org/support/users/blanch80/)
 * (@blanch80)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/conditional-shortcode-info/#post-11967027)
 * Perfect, that’s worked an absolute treat, thank you!
 * My last one on this then is are you able to advise where I can change the waiting
   list text please? Ideally I just want to change the text to bold.
 * Thanks for this Franky.
 *  Plugin Author [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/conditional-shortcode-info/#post-11967137)
 * The waiting list text is a span with an id, you can use css to change it. Currently
   the text itself can’t be changed (I haven’t made a text-option for that yet),
   but using the “[eme_if tag=’#_WAITING_LIST_ACTIVATED'” method, you can show another
   text where/how you want it (and hide via css the default text then).

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/conditional-shortcode-info/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/conditional-shortcode-info/page/2/?output_format=md)

The topic ‘Conditional shortcode info’ is closed to new replies.

 * ![](https://ps.w.org/events-made-easy/assets/icon-256x256.png?rev=1856035)
 * [Events Made Easy](https://wordpress.org/plugins/events-made-easy/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-made-easy/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-made-easy/)
 * [Active Topics](https://wordpress.org/support/plugin/events-made-easy/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-made-easy/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-made-easy/reviews/)

 * 17 replies
 * 2 participants
 * Last reply from: [Franky](https://wordpress.org/support/users/liedekef/)
 * Last activity: [6 years, 8 months ago](https://wordpress.org/support/topic/conditional-shortcode-info/page/2/#post-11976053)
 * Status: resolved