WordPress.org

Ready to get started?Download WordPress

Forums

Reading and writting to User Profile (currentuserinfo) (1 post)

  1. realsol
    Member
    Posted 5 years ago #

    I was using Register-Plus plug-in in standard WordPress. It seems to work so far with MU. Has anyone tested this plugin?

    I used it to add a custom field to the user's profile, a field called license_id. I was using code in WordPress to update this field. As far as I can remember, the code below worked in WordPress, but I have had no luck so far in MU. I was in the middle of coding this when I started to install MU so maybe it didn't work. I was hoping someone might know how to accomplish reading a writting to this custom field.

    Here is the code that reads it:

    global $userdata;
    get_currentuserinfo();
    $licenseid = get_user_option('license_id',userdata->ID);

    But I can not change it. I am trying:

    $newvalue = $licenseid;
    $option = 'license_id';
    update_user_option($userdata->ID,$option,$newvalue,true);

    but it doesn't seem to store the new value. Any suggestions.

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic