Events Manager
[resolved] filter events returned on EM_Events::output (11 posts)

  1. funmusic
    Posted 2 years ago #


    I'm trying to modify the template calendar-full.php so it only shows the events that can be booked (that is future events, and also that have tickets left).

    I am using this function

    echo EM_Events::output($cell_events,array('scope'=>'future', 'format'=>"

    But scope => future isn't working. What am I doing wrong? And also, how do I filter only events that have tickets left?

    Also ignore the 'format' key if it is irrelevant, I am using it to modify the url, I put the line exactly as it is on the source.



  2. funmusic
    Posted 2 years ago #

    I'll put again the code, because it got broken on my first post:

    echo EM_Events::output($cell_events,array('scope'=>'future', 'format'=>"<li><a href=\"#_EVENTURL?cid={$post->ID}\">#_24HSTARTTIME</a></li>"));

  3. Philip John
    Posted 2 years ago #


    That code should show all future events, but I don't see anything in there to change whether to show those with bookings available.

    How have you tried to exclude events without tickets available?


  4. Fixed.

    Please use the CODE button to wrap your code when you post it, otherwise it gets mangled, as you saw :)

  5. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    thx Mika! damn you're fast....

  6. funmusic
    Posted 2 years ago #

    Hi, with that code, the calendar shows future, present and past events. I don't know how to filter events that are booked. It is a bit wierd that by default the calendar shows fully booked events. If there isn't an option to filter that on the output function or on the calendar shortcode, maybe should I filter that events on the full-calendar.php template not inserting them on $cell_events array?

  7. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    there isn't a filter for this, you'd need to loop through results and check if something is fully booked or not, it can't be done in a db query.

  8. funmusic
    Posted 2 years ago #

    Ok, thanks, but what about showing only events in the future? It is not that important because the calendar shows the current day in other color, but should the above code work?, because it doesn't for me.

  9. angelo
    NetWebLogic Support
    Posted 2 years ago #


    try to use conditional placeholder at Events > Formatting > Calendar > Event format


    {is_future}<li>#_EVENTLINK</li>{/is_future} {is_past}<li><a href="#_EVENTURL">#_EVENTNAME</a> </>{/is_past}
  10. funmusic
    Posted 2 years ago #

    I think I can't use the wp-admin options to change the event format, because I need to modify the event link as shown in:

    <a href=\"#_EVENTURL?cid={$post->ID}\">

    I am passing a GET parameter cid (where did the user come from), because I am using this info on the booking page. And I don't have that parameter on the wordpress admin page.

  11. Philip John
    Posted 2 years ago #

    As Marcus said, you're probably going to have to get these results for use with PHP and loop through them rather than trying to use the normal formats settings.


Topic Closed

This topic has been closed to new replies.

About this Plugin

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

About this Topic