• Resolved Sosuire

    (@sosuire)


    Hello,

    I follow your tuto for callback. It work well with classic dropdown but not with multi-select.
    Under the ‘Choices Callback’ field I don’t see the ‘Parent Option’

    So the function don’t work:

    function getStates() {
    //get the value from the ‘parent’ field, sent via the AJAX post.
    $choice = $_POST[‘parent_option’];

    I would like :
    Select a first categorie
    Then open a multi-select choice for this categorie

    Thank you

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hi @sosuire

    Unfortunately, Multi-select doesn’t support the Parent Option. I’ll add this to our feature request list. Let’s see if others in the forum have made this possible with customization.

    Thread Starter Sosuire

    (@sosuire)

    Thank you for add to your feature request !
    I hope a developper could answer me.
    I search but I found nothing about. I imagine it’s not really difficult but I’m a webdesigner, not a developper and my php knowledge is very basic ..

    I would like to developpe that for a client. For now your plugin seams to be the best for our purpose. Only this point is not really good for us.

    Thanks !

    Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hi @sosuire

    You can try this code snippet to add a parent option to your child field:

    add_filter("um_get_field__location_states", function( $array ){
    
        $array['parent_dropdown_relationship'] = "location_address";
    
        return $array;
    });

    Just change the location_states to your Child field and then change the parent field meta key from location_address to your parent field’s meta key.

    Thread Starter Sosuire

    (@sosuire)

    Hello
    Thank you for answer ! I have time to test it today !

    I don’t know where to add the php code. I belive it’s under the function getStates

    But my tries are wrongs : the multi select display all options independently of location_states’s choice.

    Thank you angain for help !

    @sosuire

    Install the code snippet into your child-theme’s functions.php file
    or use the “Code Snippets” Plugin.

    https://wordpress.org/plugins/code-snippets/

    Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hey @sosuire

    Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. 🙂

    Regards,

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

The topic ‘Multi select call back’ is closed to new replies.