Support

Home Forums Event Espresso Premium howto link custom question link to the wp user profile

howto link custom question link to the wp user profile

Posted: February 19, 2016 at 1:34 pm


Victor Quinten

February 19, 2016 at 1:34 pm

Hi There,

how can i link or how to i link the fiels from the custom questions to the wp_user_meta data?

for example, when an logged in user is requerd to give his firstname or lastname this is prefilled.

for example i want to prefill the user adres field.

How can I arrange this?
Thanks for the replys 🙂


Josh

  • Support Staff

February 19, 2016 at 1:49 pm

This will not add the address info to the user_meta, but it will pre-fill the address fields if they’ve filled them out before from any earlier registration:

https://github.com/eventespresso/ee-code-snippet-library/blob/master/addons/eea-wp-user/jf_filter_address_answer_for_wpuser.php


Victor Quinten

February 19, 2016 at 2:48 pm

Hi Josh, thanks for the reply. can u confirm; i full one time all the custom question fields in for the first registration. 2nd registration the custom fields are pre filled.


Josh

  • Support Staff

February 19, 2016 at 4:30 pm

Address fields, City, State, Zip > Yes. Other custom questions, no.

If you also need to pre-fill custom questions too that are not system questions, you’ll use this code:

https://github.com/eventespresso/ee-code-snippet-library/blob/master/checkout/mn_wp_user_addon_save_custom_answers_too.php


Victor Quinten

February 22, 2016 at 1:01 am

i want to also the other custom questions to be prefilled.
can i use the github code in my functions.php ?


Lorenzo Orlando Caum

  • Support Staff

February 22, 2016 at 7:01 am

Hi Victor,

A functions.php file can be used if you are using a child theme. If you are not using a child theme, then your customizations to the functions.php file will be lost when you update your theme.

A site specific plugin is a good option as it won’t be affected by updates to your theme:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/


Lorenzo


Victor Quinten

March 2, 2016 at 3:16 pm

Hi Lorenzo,
all custom fields are no working except the phone field.
how can i assive this field also to be prefilled?


Josh

  • Support Staff

March 2, 2016 at 3:28 pm

You add some more code to handle the phone number field like in this example:

https://monosnap.com/file/9vnATlxCx2Purks4O2gUM9WpCh9UKb


Victor Quinten

March 3, 2016 at 3:11 am

hi Josh,

thanks for the reply, can u tell me abit more?


Lorenzo Orlando Caum

  • Support Staff

March 3, 2016 at 7:04 am

Hi Victor,

Josh shared an example here:

https://eventespresso.com/topic/howto-link-custom-question-link-to-the-wp-user-profile/#post-193328

You could then extend it (make an addition) to pickup the phone number by adding another variable and then a case at the end. See the red text in this screenshot:

https://monosnap.com/file/9vnATlxCx2Purks4O2gUM9WpCh9UKb


Lorenzo

The support post ‘howto link custom question link to the wp user profile’ 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.

Event Espresso