Title: Please explain &#8216;Choices Callback&#8217;
Last modified: August 27, 2018

---

# Please explain ‘Choices Callback’

 *  [meneeroom](https://wordpress.org/support/users/meneeroom/)
 * (@meneeroom)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/please-explain-choices-callback/)
 * I’ve been struggling for hours to find some guidance as to how to make the Choices
   Callback work, I don’t know how to populate the defined field. I found how to
   do the function at [https://www.snip2code.com/Snippet/1669213/Example-Callback-function-for-Ultimate-M/](https://www.snip2code.com/Snippet/1669213/Example-Callback-function-for-Ultimate-M/),
   but when I add getCities() to the Choices Callback field in the editor, it says
   I must still add edit choices, so I can’t continue.
 * What are the steps to populate the field, what should be in the
    Choices Callback
   and Edit Choices fields in the editor when my function’s name is getCities() 
   in functions.php?

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

 *  Thread Starter [meneeroom](https://wordpress.org/support/users/meneeroom/)
 * (@meneeroom)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/please-explain-choices-callback/#post-10633775)
 * I found a solution by trying 1mil things.
 * The WP Backend Field must look like this:
 * The `Edit Choices` field can’t be empty (this is definitely a bug), so you have
   to put something in there like an `*`.
 * Then, in the `Choices Callback` field, you must add your PHP function name, with
   no brackets. Ie, if your PHP function in functions.php is `function getCities(){...}`,
   the field must contain only `getCities`.
 *  [Rick](https://wordpress.org/support/users/rickpro/)
 * (@rickpro)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/please-explain-choices-callback/#post-10696454)
 * Thanks for putting the solution to your problem. That is very helpful. I am just
   starting to work with callback choices and you just saved me major future headaches.
   Thanks!

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

The topic ‘Please explain ‘Choices Callback’’ 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/)
 * [choices](https://wordpress.org/support/topic-tag/choices/)
 * [choices callback](https://wordpress.org/support/topic-tag/choices-callback/)

 * 2 replies
 * 2 participants
 * Last reply from: [Rick](https://wordpress.org/support/users/rickpro/)
 * Last activity: [7 years, 6 months ago](https://wordpress.org/support/topic/please-explain-choices-callback/#post-10696454)
 * Status: not resolved