Events user is attending
WordPress Event Management, Calendars & Registration › Forums › Pre Sales Questions › Events user is attending
This topic contains 3 replies, has 2 voices, and was last updated by Stephen Harris 9 years, 9 months ago.
-
AuthorPosts
-
We have members who need to be able to add events and it looks like the FES plugin will work for that. Events will be on display to the general public but no booking is required.
In the members area the members need a list of their events displayed on a page. I tried the shortcode [eo_events users_events=true] but it just displays all events because obviously the member hasn’t “booked” himself into the event. Will the FES plugin provide some functionality for that or can you suggest another way around it?
Alternatively would the shortcode [event_search filters=”bookee_id”] show the events belonging to that member based on their ID after logging in? And this shortcode requires the pro version, correct?
Tracey“Event user is attending” in this context refers to having a (confirmed) booking for an event, which is entirely separate from FES.
FES allows you to allow submissions from the logged-out users, for those users, it wouldn’t be possible to display a list of events they’ve submitted. For logged-in users you can.
If the user submitting the event shall be the “event organiser” (this is just the ‘post’ author), then you can just use:
[eo_events author={user-id}]
where
{user-id}
is replaced by the user’s ID. Obviously this is expects a static value, and you want to to be the ID of the current user. So you could use the following snippet:add_shortcode( '[users_events]', 'my_users_events_shortcodes' ); function my_users_events_shortcodes(){ $user_id = (int) get_current_user_id(); return do_shortcode( '[eo_events author='.$user_id.']' ); }
and then use the following shortcode:
[users_events]
If in general the submitter is not going to be the ‘post author’ (by default they are), then it’s still possible, but not with a default shortcode, and it’s slightly more involved.
I realise the
author
attribute of the event list (and fullcalendar) shortcodes are not very useful at present, since it only supports static values. This shall be remedied in a future update.Stephen HarrisThanks, that sounds good. Do I need the pro version of the plugin for that shortcode to work?
And as regards adding events for logged in users – it seems this is only possible through wp-admin, is that right? That’s why I thought it needed the FES plugin. We want to provide an interface that looks the same as the rest of the website rather than wp-admin.
TraceyNope, the above would work with the base version.
FES allows logged-in users to submit events from the front-end too. My comment was merely to highlight that you can’t list “their” events if that person cannot be identified (i.e. is logged-in). So members would have to be logged in when submitting an event (this can be enforced via the plug-in settings).
Stephen Harris -
AuthorPosts