Title: Multi-select field callback irregularities when saving.
Last modified: May 21, 2019

---

# Multi-select field callback irregularities when saving.

 *  [Krolyn Studios](https://wordpress.org/support/users/krolyn/)
 * (@krolyn)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/multi-select-field-callbacks-irregularities-when-saving/)
 * Since a recent update (after v2.0.43), I have noticed some irregularities when
   using a callback function and saving multi-select fields.
 * Although I can see the options in the ‘edit’ mode, they don’t always save and
   sometimes result in an empty field. I’ve performed plugin conflict testing, disabled
   caching, and the problem persists.
 * Problem resolves when reverting back to v2.0.43.

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Thread Starter [Krolyn Studios](https://wordpress.org/support/users/krolyn/)
 * (@krolyn)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/multi-select-field-callbacks-irregularities-when-saving/#post-11557660)
 * Further to the previous post, it appears to cause issues when you add another
   entry to the callback array AFTER it has been saved as a field in the form. The
   entry appears in the front-end ‘edit’ screen but does not save if selected.
 *  Plugin Support [Ultimate Member Support](https://wordpress.org/support/users/ultimatemembersupport/)
 * (@ultimatemembersupport)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/multi-select-field-callbacks-irregularities-when-saving/#post-11564034)
 * Hi [@krolyn](https://wordpress.org/support/users/krolyn/),
 * Can you please make sure to update to the latest 2.0.48 version of the Ultimate
   member core and see if it helps.
 * Regards.
 *  Thread Starter [Krolyn Studios](https://wordpress.org/support/users/krolyn/)
 * (@krolyn)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/multi-select-field-callbacks-irregularities-when-saving/#post-11564695)
 * [@ultimatemembersupport](https://wordpress.org/support/users/ultimatemembersupport/)
   I had. It’s when I first realised the problem.
 *  Thread Starter [Krolyn Studios](https://wordpress.org/support/users/krolyn/)
 * (@krolyn)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/multi-select-field-callbacks-irregularities-when-saving/#post-11574245)
 * [@ultimatemembersupport](https://wordpress.org/support/users/ultimatemembersupport/)
   Please advise.
 *  [kabienf](https://wordpress.org/support/users/kabienf/)
 * (@kabienf)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/multi-select-field-callbacks-irregularities-when-saving/#post-11641408)
 * Hello [@krolyn](https://wordpress.org/support/users/krolyn/),
 * Sorry, my answer will not give you the solution, I just wanted to let you know
   that I face the exact same problem with callback on dropdown (I ask a question
   about it on this subject: [https://wordpress.org/support/topic/bug-using-choices-callback-field-not-visible-in-view-mode/#post-11640656](https://wordpress.org/support/topic/bug-using-choices-callback-field-not-visible-in-view-mode/#post-11640656)).
 * All options added by the callback and that have not been “displayed” in the field
   edit mode in the choices list will not be saved.
    This prevent using callbacks
   to populate dropdown or multi-select options with new values from the database
   🙁
 *  Thread Starter [Krolyn Studios](https://wordpress.org/support/users/krolyn/)
 * (@krolyn)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/multi-select-field-callbacks-irregularities-when-saving/#post-11641815)
 * According to [@ultimatemembersupport](https://wordpress.org/support/users/ultimatemembersupport/),
   they are aware of the issue and it’s being resolved in the next release.
 *  [kabienf](https://wordpress.org/support/users/kabienf/)
 * (@kabienf)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/multi-select-field-callbacks-irregularities-when-saving/#post-11646603)
 * Thanks for the feedback [@krolyn](https://wordpress.org/support/users/krolyn/),
 * For information, If you ever need a quick way to bypass this behavior, the code
   that prevents a value that is not set in the field’s options list to be saved
   while submitting the form is in the file class-validation.php, line 75 :
    `if(
   in_array( $fields[ $key ]['type'], array( 'select', 'radio' ) ) && isset( $value)&&!
   empty( $fields[ $key ]['options'] ) && ! in_array( $value, $fields[ $key ]['options'])){
   unset( $changes[ $key ] );`
 * I tried to comment this line and was able to save my field value.
    That should
   work until the next release.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Multi-select field callback irregularities when saving.’ is closed to
new replies.

 * ![](https://ps.w.org/ultimate-member/assets/icon-256x256.png?rev=3160947)
 * [Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin](https://wordpress.org/plugins/ultimate-member/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-member/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-member/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-member/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-member/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-member/reviews/)

## Tags

 * [callback](https://wordpress.org/support/topic-tag/callback/)
 * [Multi-Select](https://wordpress.org/support/topic-tag/multi-select/)

 * 7 replies
 * 3 participants
 * Last reply from: [kabienf](https://wordpress.org/support/users/kabienf/)
 * Last activity: [7 years, 1 month ago](https://wordpress.org/support/topic/multi-select-field-callbacks-irregularities-when-saving/#post-11646603)
 * Status: not resolved