Selecting Multiple Users with Select Doesn’t Get Saved
-
This is my example code for the meta box.
foreach ($users as $user) { $options[$user->ID] = $user->user_login; } $meta_box->addSelect($prefix . "a[]", $options, array('name' => 'name', 'multiple' => true));
And here’s the code that should save the selections.
for ($users as $user) { update_user_meta( $user->ID, "a", $_POST["a"]);
I don’t know why it’s not working. If I switch to single select by setting ‘multiple’ to false and removing the ‘[]’ it works, but it doesn’t work when I’m trying to multi-select.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Selecting Multiple Users with Select Doesn’t Get Saved’ is closed to new replies.