Support » Plugin: Events Manager » Events Manager plugin only show events with bookable spaces available

  • Resolved madmaia

    (@madmaia)


    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.

    https://wordpress.org/plugins/events-manager/

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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}') );

    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!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Events Manager plugin only show events with bookable spaces available’ is closed to new replies.