• Resolved Mikel

    (@ogmic)


    Hi guys, i would like to ask if you could me with a way to copy a custom meta field ‘phone_number” saved in the uwp_usermeta database table to the default wp_usermeta table.

    Thanks a bunch!

Viewing 1 replies (of 1 total)
  • Plugin Support alexrollin

    (@alexrollin)

    Hello,

    this isn’t a feature of UsersWP but I will share a snippet to help get you started on your custom feature.

    Try adding following code in your functions.php file or use a code snippet plugin:

    add_action('uwp_after_extra_fields_save', 'uwp_after_extra_fields_save_cb', 10, 4);
    function uwp_after_extra_fields_save_cb($save_result, $result, $type, $user_id){
        if('register' == $type && !is_wp_error( $save_result ) && isset($result['phone_number'])){
            update_user_meta($user_id, 'phone_number', $result['phone_number']);
        }
    }

    Please note you need to change the key ‘phone_number’ according to your requirements.

Viewing 1 replies (of 1 total)
  • The topic ‘Copy custom field meta value to default wp usermeta’ is closed to new replies.