latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

update_user_option

Home Forums Community Forum update_user_option

This topic contains 2 replies, has 2 voices. Last updated by  Jason (Lead Developer) 3 years, 10 months ago.

Topic Author Topic
Posted: Monday Feb 18th, 2013 at 9:38 pm #42390

Just recently upgraded to pro.

I am trying to do what is outlined in the post below, but I am having problems.

http://www.s2member.com/forums/topic/populate-wordpress-user-details/

I have added an echo line to make sure the function is getting called (which it is), but the data is not getting updated.

Here is my code:

add_action('ws_plugin__s2member_after_handle_profile_modifications', 'update_user_url');
function update_user_url($vars = array())
{
	$user = $vars['user']; // A WP_User object instance.
        update_user_option($user->ID, 'test', 'testtest');
        echo "My Hook works.";
}

I have tried many different combinations of code, and nothing has worked.

The form was built in the free version, I upgraded to pro, added the new “test” field and hook, and still nothing is getting updated.

List Of Topic Replies

Viewing 2 replies - 1 through 2 (of 2 total)
Author Replies
Author Replies
Posted: Monday Feb 18th, 2013 at 11:36 pm #42410

finally got it working

$meta_value = get_user_meta( $user_ID, 'the_meta_key_from_wp_usermeta', true );    
        $meta_value['your_custom_field'] = 'asdf';
        update_user_meta($user_ID, 'the_meta_key_from_wp_usermeta', $meta_value);
Posted: Tuesday Feb 19th, 2013 at 1:11 am #42418
Staff Member

Glad to hear you got this working. Thanks for the follow-up!

Viewing 2 replies - 1 through 2 (of 2 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.