Support » Plugins and Hacks » Events Manager » [Resolved] [Plugin: Events Manager] Custom search attribute not working with [events_calendar]

[Resolved] [Plugin: Events Manager] Custom search attribute not working with [events_calendar]

  • I’ve created custom search terms to filter a user choice of selecting wether an event should be hidden or not.

    [events_list hidden=”yes”] produces a list of the events that are checked as hidden. when hidden=”no” it only shows events checked as not hidden. this is fine.

    [events_calendar hidden=”yes”] or hidden=”no” both give a calendar with all events displayed, seemingly ignoring my search filter.

    I created my code by following the “creating a custom add-on” tutorial and I read that you should be able to use new search attribute in any of the event, calendar or location shortcodes. Is there something else I’m missing, something I need to add to support the use of this filter on calendars?


Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Marcus


    should work if it works for events list (calendar uses EM_Events::get()). If not, I’d advise you check what $args are passed during the functions and figure out where it’s been taken off.

    In my functions passed into em_events_get_default_search and em_events_get I changed them form the tutorial to check for is_string instead of is_array because my values will only be on of two things. Would this cause the events_calendar shortcode not to accept the values being passed?



    Hey Marcus, I’m working on this same project with Jarrod. It looks like

    [events_list hidden="yes"]

    works and

    [events_calendar hidden="yes"]

    does not. That indicates to me that the logic in the functions is working, we just need to figure out how to make events_calendar see the ‘hidden’ variable. When we print the args in the function we see it when calling events_list and not when calling events_calendar.

    Do we need to run the filter on a second function or something? Maybe at a different time?

    Plugin Author Marcus


    in theory it should just work. don’t remember if I tested the em_calendar, i will try it out with the tutorial i made, see if that works and get back here



    Any luck?

    Plugin Author Marcus


    just checked this, i can get it to work by adding


    as well as the em_event_get_.. filter

    That solution is almost obvious now that you showed me.

    Thank you so much, it works great!

    Also, I recently made a calendar with EM that I think turned out really nice, using jQuery to show (on hover of date) a hidden, formatted list of events from a “full” calendar but styled (and using a customized calendar template) to look more like the small one and fit in a widget. I don’t know if you have any sort of showcase for EM but I think it would help users visualize what’s possibile. I’d be happy to do a write up on how I did it too. The site with the calendar is not live just yet but if you’re interested in this let me know. I’m probably going to do a write up about it regardless for my local WP group.

    Thanks again! I really love Events Manager!

    Plugin Author Marcus


    sounds interesting, we will have a showcase section too (along with a demo), so could go on there. if you send a link via our site contact form that’d be nice

    Love the plugin – just have one query:

    When I run a search that doesn’t match any of the events it just returns nothing (as you’d expect) but I was wondering how I can get it to display a message like “no events found for this area” or something.

    I have edited the events-search.php but even when I revert back to the original I get the same thing. I noticed in events-search.php there is a comment that says:

    //in order for this to work, you need the above classes to be present in your theme

    What class is that referring to? Is it the em-events-search-form class? Sorry if these questions are lame but I’m just trying to get my head around it.

    Any input much appreciated – thanks

    Plugin Author Marcus


    you’d want to edit the events-list.php template file. There’s an if clause that deals with no events.

    Cheers Marcus – thanks for all the support and the awesome plugin.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Resolved] [Plugin: Events Manager] Custom search attribute not working with [events_calendar]’ is closed to new replies.