Events Manager
[resolved] Events Manager plugin only show events with bookable spaces available (3 posts)

  1. madmaia
    Posted 2 years ago #

    I have a php function to display events in a particular category, but I only want to output events that still have bookable places - the equivalent of the "has_spaces" conditional shortcode. Is there are method for $EM_Events that tests for this? I can't find any documentation.


  2. caimin_nwl
    NetWebLogic Support
    Posted 2 years ago #

    You can use conditional placeholders within the output string by including them under 'format'. Something like this:

    echo EM_Events::output( array( 'format'=>'{has_spaces}something here{/has_location}') );

  3. madmaia
    Posted 2 years ago #

    Goodness, I didn't know that, thank you! In the end I fixed it by delving in to the plugin code and finding methods, so I have

    $bookings = $EM_Event->get_bookings();
    if (($bookings->is_open()) && (($bookings->get_available_spaces()) > 0)) {
    $bookable_events[] = $EM_Event;

    But I will make a note of that, it will be really useful, thank you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.