Change User FIelds Data With Php
-
When a create a custom user field (type url) from the profile form with the meta key “aml_test_results”, then edit the users field in the profile page – I can see it updates the users meta to that same value when calling the following in php:
echo get_user_meta(get_current_user_id(), 'aml_test_results', true);
or
echo um_user('aml_test_results');but after updating the meta in php for example:
`update_user_meta( get_current_user_id(), ‘aml_test_results’, “newvalue” );then
echo get_user_meta(get_current_user_id(), 'aml_test_results', true);
shows “newvalue”
while
echo um_user('aml_test_results');
shows the old value and the value is not updated in the user profile.How can I update the value in the user profile with php?
The topic ‘Change User FIelds Data With Php’ is closed to new replies.