Hi Stephen,
Could you give me a pointer as to how to allow a user who’s booked one or more events to see the list of events booked, please?
Thanks!
John
s2dd
This is currently earmarked for 1.3 (~June) which will add widget/shortcodes for listing a user’s booking history/ up-coming events they are attending.
If you wanted to implement something yourself you can use eventorganiser_get_bookings()
(docs in source, see includes/bookings
directory). Bookee ID is the user ID of the bookee.
You could use that to create your own shortcode ( http://wp-event-organiser.com/blog/tutorial/creating-your-own-shortcodes/) . To get the logged-in user’s ID: get_current_user_id()
Stephen Harris
Hi Stephen –
Thank you for that. I’ve successfully got a list of bookings as an array, using $wp_query = false. However, I’d like to output them as a list of posts (in effect) – so similar to the view of bookings in the admin section.
I’ve tried coding to use wp_query but without success.
As you may have guessed I’m somewhat green to WP development. Sadly this can’t wait until June, so I’d be hugely grateful for any pointers you can give me.
Thanks!
John
s2dd
Hi John,
If it can wait until next week I can email you an alpha-version of what will be included in the next update (in particular the ‘booking history’ shortcode). I think that’s pretty much what you’re after…
Stephen Harris
Hi Stephen,
I’ve looked at the updated documentation in the new version of bookings.php and it’s brilliant – I think I should be able to get the results I need, so thank you.
I’ve got other functionality to build, however, so watch this space…!
John
s2dd
I’ve looked at the updated documentation in the new version of bookings.php
I’ll be publishing the documentation on the site shortly :), but kudos for going straight to source.
Look out for @access private
and @ignore
tags – they generally indicate a function which you shouldn’t be using (because I may change it without warning).
Another ‘rule of thumb’, function prefixed by eo_
indicates a function you can use, and eventorganiser_
you should not.
But use of those tags is a bit sparse, and until I go through and update the inline docs, really only functions published on the site are ones that can be (safely) used by third-party plug-ins/themes. But if you do need to use a function, just let me know so I’ can try not to break it :).
In the meantime I’ll be ‘revealing’ more of the API with each major update.
Stephen Harris