Store meta data for a user

  update_user_meta(get_current_user_id(), 'my-meta-key-name', $ValueToStore);

Read meta data for a user

Single Value
    $ValueStored = get_user_meta(get_current_user_id(), 'my-meta-key-name', True);    //True = read single value
    if (($ValueStored != False) && ($ValueStored != ''))      //False for an invalid $user_id int value, empty string if a valid but non-existing user ID is passed
    {
      //Sucessfully read
      
    }
Array of values
    $ValuesArray = get_user_meta(get_current_user_id(), '', False);    //False = read array of values value
    if (($ValuesArray != False) && ($ValuesArray != ''))      //False for an invalid $user_id int value, empty string if a valid but non-existing user ID is passed
    {
      //Sucessfully read
      
    }

Delete meta data for user

  delete_user_meta(get_current_user_id(), 'my-meta-key-name');
Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.

Comments

Your email address will not be published. Required fields are marked *