Trying out Formidable’s API key to update all user profiles via my registration form in Formidable.
What am I trying to do?
Update all my users so that they can have industry_format meta present in the db
What does my code do?
In summary, this code ensures that whenever a user's profile is updated, the "industry_format" user meta is updated to reflect the formatted and sanitized version of the user's selected industries. This helps maintain consistency and accurate data in the user meta fields. Industry is where the user selects any industry that best describes them. *See photo* Here's what I've done:
As you can see there is an error "code": "rest_no_route", "message": "No route was found matching the URL and request method.", "data": { "status": 404 Went through these troubleshooting steps: The "No route was found matching the URL and request method" error with a status of 404 indicates that the API endpoint you're trying to access is not recognized by the server. This can happen for several reasons:
https://stg-central.vib.community/wp-json/frm/v2/forms/{form_id}/entries
.{form_id}
placeholder is replaced with the actual ID of the form you want to work with. Ensure that the form ID is correct and corresponds to a form in your Formidable Forms setup./frm/v2/
) matches the version of Formidable Forms you're using.To troubleshoot this further:
I went through these troubleshooting methods. Can anyone please look over to see if I set this up properly? What am I missing here?
Next, your update code is wrong. WordPress does not store empty meta values and you test for empty value then use update_user_meta. If the field doesn't exist, you need to add it. There's nothing to update.
If you're trying to do a bulk update, write a PHP function that loops through all users to update them accordingly. The easiest approach is to fire the function in functions.php so it all updates before the site is loaded. Thereafter, you can use frm_after_create_entry and frm_after_update_entry to update records going forward.
Please login or Register to submit your answer