Two issues while trying to update wordpress user meta <p>I have a form that is submitting data to a php script. Here is some of the code in the script.</p> <pre><code>foreach ($newuser_values as $key =&gt; $value) { echo $key; echo $value; switch ($key) { case "show_name": echo "1"; switch ($value) { case "first": $update_val = $current_user-&gt;user_firstname; break; case "first_initial": echo "HI"; $update_val = $current_user-&gt;user_firstname . " " . substr($current_user-&gt;user_lastname,0,0) . "."; break; case "first_last": $update_val = $current_user-&gt;user_firstname . " " . $current_user-&gt;user_lastname; break; default: echo "HELLO"; $update_val = $user_identity; } echo $update_val; update_user_meta($user_ID, $show_name, $update_val); echo get_user_meta($user_ID, $show_name); ... } } </code></pre> <p>$newuser_values is an array of form info. I get it like this:</p> <pre><code>$newuser_values = $_POST['edit-profile']; </code></pre> <p>I have two issues here. They can both be seen from the beginning of the script output (from echo statements). The script output is:</p> <p>show_namefirst_intital1HELLOtestuser1Array</p> <p>Problem 1: As you can see, the script prints a 1 which means that it is entering the case titled "show_name" of the switch on $key. However, it does not enter the case entitled "first_intial" of the switch on $value. Why is this?</p> <p>Problem 2: Anyway the script enters the default case of the switch on $value and prints HELLO. Then, it prints the $update_val which is the testuser1. However, that value is not getting assigned to the user_meta because it is printing "Array". Why is this?</p> <p>Thanks in advance. I apologize if these questions are simplistic. I am pretty new to wordpress and web development.</p>