• I want to add a new WP user, with UM default form field values and then add that user to a UM member directory via REST API.

    I saw this post which go overs how to add a user, but what about adding values for my UM default profile form?

    Also, after the user is created, how can I add the newly created user to UM member directory?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @powpow12

    You can use the same REST API and then add the meta in the API request. Please also see this Stackoverflow answer: https://wordpress.stackexchange.com/a/290973

    Regards,

    Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hi @powpow12
    …Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help… ??

    Thread Starter powpow12

    (@powpow12)

    Thanks @champsupertramp for the coding example. I think the major difference between what that S.O question is doing vs is what I am doing is that mine is external to WordPress so in my limited experience, I wouldn’t use register_meta().

    I was able to test this out a little and have an UM user but one issue is that I can’t seem to update the submitted meta_key which has the registration field submission aka profile. What this leaves me with is a created wordpress user that has a UM role but no profile data.

    
    curl --user "api_user_name:application_key" \
         -X POST \                                              
         -H "Content-Type: application/json" \
         -d '{"username":"username","password":"password","email":"[email protected]","first_name":"first","last_name":"last","description":"is it a test","roles":["um_directory-member"],"meta":{"submitted":{"display":["Yes"],"description":"","read-add":"","provider-type":"PA","degree":"PA","SpecialtiesChk":["Primary Care"],"form_id":"679","um_request":"","_wpnonce":"","_wp_http_referer":"\/directory-sign-up\/","g-recaptcha-response":"","user_login":"username","first_name":"first","last_name":"last","user_email":"[email protected]","title":"Physician Assistant","organization":"USAF","phone_number":"123-456-7890","secondary_user_email":"","user_url":"http:\/\/NA","address":"","addreUL":"","addreUL_lat":"","addreUL_lng":"","addreUL_url":"","timestamp":1644382392}, "um_member_directory_data":{"account_status":"approved","hide_in_members":false,"profile_photo":false,"cover_photo":false,"verified":false}}}' \
         https://domain.com/wp-json/wp/v2/users

    `

    When I query the usermeta table, I do see a meta_key um_member_directory_data but I do not see one for submitted. In the UI, when I click profile, I don’t see any fields filled out. How can I make sure the UM registration form is filled out as part of the user create POST?

    • This reply was modified 2 years, 8 months ago by powpow12.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add user, update UM default profile form, add to member directory via REST’ is closed to new replies.