Tips and Tricks HQ Support Portal › Forums › WP eMember › Updating Custom Fields with API
- This topic has 4 replies, 2 voices, and was last updated 6 years, 8 months ago by swdvv18.
-
AuthorPosts
-
March 13, 2018 at 4:42 pm #14766swdvv18Spectator
I am using Formidable Forms and Formidable API to link up with eMembers and update a member’s profile. The core fields are working great with the Update form I created, but I still can not update the custom fields.
I have installed eMember in the last few months, using v10.0.4.
I have tried several variations of the field name, but I am not sure if its that.
I have one very basic text field, Test Field, that I am using for testing purposes.
I am missing something on the field name? or is there another method to update custom fields?
Ultimately I have 2 radio fields that I would like to update through my form.
Thank you in advance for your assistance.
March 13, 2018 at 10:09 pm #77498wzpModeratorIf the custom field name has a space character, replace it with an underscore. Are you using this API to access the custom fields?
March 13, 2018 at 10:57 pm #77499swdvv18SpectatorHi,
I can retrieve the field values from the text field into the form using eMember shortcode, [wp_eMember_user_details user_info=”Test_Field”].
It’s when I try to update the text field value using the API update.php that I run into problems. All the core fields I can update.
Here is the Formidable Forms API screen.
https://drive.google.com/file/d/1yv1aoX0_gALXboTBWND9qJjWZI3BKvQq/view?usp=sharing
I have a log result from FF API and it says it was successful, but when I check the member profile (WP eMember > Members > Edit) the test field is not updated.
Is there a log that I can check if there is an error?
frm_action
1390
frm_entry
190
frm_code
200
frm_message
Success!
Member profile updated.
frm_url
xxxx/wp-content/plugins/wp-eMember/api/update.php (I edited the path on my development server)
frm_request
secret_key=v76uzeyuswep&member_id=26&Test_Field=Toaster&first_name=Daffy&last_name=Duck
frm_headers
Content-type: application/x-www-form-urlencoded
March 13, 2018 at 11:22 pm #77500wzpModeratorIf you look inside the api/update.php file at about line 44, there is a list of the fields that can be updated. Those are the fields that are part of the member’s basic profile.
Currently, there is no provision in api/update.php to handle the updating of custom fields.
Note: The api/query.php file seems to support custom field queries, so I don’t see why updating of custom fields couldn’t be done as well.
March 14, 2018 at 8:39 pm #77501swdvv18SpectatorOk, that was a great starting point.
I managed to inject code from eMember_profile_utils.php and custom_field_template.php in the root folder of eMember into the api/update.php to accomplish what I wanted.
Obviously this solution will be a problem with updates, but can live with it for now.
Thank you for help.
-
AuthorPosts
- You must be logged in to reply to this topic.