I am wanting to add in some specific stylesheets and js if the user is viewing a particular event’s page – not a problem until it goes to the registration and the POST no longer references the event, but is the registration page instead. How can retrieve data on the event that is being displayed on the registration page? EE_Core::get_event(); – hoping for something of the sort.
You would need to write a function and add it to the ‘AHEE__registration_page_attendee_information__start’ action. That action passes a var called $event_queue to functions that are hooked to it which contains an array with the key “items” which is an array of cart line items and each line item has a key called “event” which contains the event object. Then it should be easy enough to check the event object’s id and comparing it to the list of event id’s that you want to check for and enqueueing the CSS and JS if there is a match.
Thanks for the reply. I imagine this is better than accessing that information directly through the Registry object, as I believe you can get to cart data through the EE_Registry::instance(); as well, however tying into the hook would likely be a safer way of ensuring all required calls have run rather than depending of the placement of wp_enqueue_scripts being far enough along in the process.
The support post ‘Accessing Event information programmatically while on the registration page’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.