I am trying to get customer Meta information to auto-populate the Event Espresso “Questions” that appear when registering for an event. I have already found a way to add the meta boxes under their user profile. I now am looking to update those meta boxes when they answer the event “Questions” OR, if they fill out the information under their user profile, have it auto-populate when they’re registering for the event. Screenshot link below.
Saving the question data to user meta shouldn’t be too hard, I would look at hooking in on action_hook_espresso_save_attendee_data and grabbing the $_POST data and saving it from there.
The awkward part is making sure you have the right ID/name for the question.
Auto filling the questions is harder. I haven’t delved into it but looking at the code, the best bet would be to create a custom event_espresso_add_question_groups function as it is pluggable (/wp-content/plugins/event-espresso/includes/functions/main.php) that way you can inject the answers in.
As an example I used this in the function, so it would add text to the answer field for the question with the ID 12 (this ID is the internal database ID, NOT what is shown via the HTML):
The support post ‘Linking Questions to User Meta’ 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.