Dropdown in Profile Form Is Saved as Number Instead of Text
-
Hi!
I have a problem with a dropdown not being saved correctly. The dropdown is part of the registration and there is works perfectly fine. The content of the dropdown is saved as text. However, I also included it within the profile form, so users can update it (on https://mydomain.com/account/)
So the problem is, when the dropdown is changed in the profile and updated, it is no longer saved as text, but as a number.
In my backend I created an extra column in the user overview that represents the values. There you can clearly see the wrong values.
I used this code to add my extra dropdown field to the profile form on the account page.
function modify_user_table($columns) { $new = array(); foreach ($columns as $key => $title) { if ($key == 'posts') $new['therapy_center'] = 'Therapiezentrum'; $new[$key] = $title; } // $column['therapy_center'] = 'Therapiezentrum'; return $new; } add_filter('manage_users_columns', 'modify_user_table'); function modify_user_table_row($val, $column_name, $user_id) { switch ($column_name) { case 'therapy_center' : return get_the_author_meta('therapy_center', $user_id); default: } return $val; } add_filter('manage_users_custom_column', 'modify_user_table_row', 10, 3);
- The topic ‘Dropdown in Profile Form Is Saved as Number Instead of Text’ is closed to new replies.