• Hi,
    I hope someone can point me in the right direction.

    I would like to know how to properly use the callback and parent field to populate a dropdown field in my user profile form.

    I have a dropdown that populates from a custom taxonomy and based on the selection of this field I would like my other dropdown to be populated with the children of the previous dropdown selection.

    For example if I choose united states in my first drop down, that I can bring the 50 states in my state drop down.

    Thanks in advance for any help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter alanxr

    (@alanxr)

    Anyone? ??

    Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hi @alanxr,

    Unfortunately, we are not able to provide any support when it comes to customizing the plugin. You can however visit the documentation page for developers or post this in our github page for code samples and guidance.

    https://docs.ultimatemember.com/collection/28-for-developers
    https://github.com/ultimatemember/ultimatemember/issues

    Thanks.

    Thread Starter alanxr

    (@alanxr)

    @ultimatemembersupport thanks for the response, but I think that you should have your features documented. The callback field and parent fields within your profile fields should have an example of at least how to use them.

    What’s allowed in those fields? If I want to use the Callback field, should I create my custom function in the functions.php and just make a call to it? Or should it be used with a specific hook from ultimate members? The same goes for the parent field, what exactly can I expect to receive in that field and how can I retrieve it’s value?

    There’s nothing in your documentation nor GitHub about it.

    Any help would be appreciated. I’m not asking for help modifying your plugin just help in understanding how to use what you provide.

    I love the plugin so far but I would really like to learn how to use this.

    Thanks!

    I discovered that you have to add a callback function in your functions.php file. See example below. Here is the link where I did find some info.

    https://www.snip2code.com/Snippet/1669213/Example-Callback-function-for-Ultimate-M/

    Sample Code

    function getCities() {

    $cities = [
    “Paris” =>”Paris”,
    “Marseille” => “Marseille”,
    “Lyon” => “Lyon”
    ];

    return $cities;

    }

    • This reply was modified 7 years, 6 months ago by Mathis Tate.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Callback and Parent field in profile fields’ is closed to new replies.