• Resolved konsument

    (@konsument)


    Hey folks.

    How can I deactivate select2 in my forms? I really want to have the normal select fields.

    best

Viewing 1 replies (of 1 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @konsument

    You can try this code snippet to disable the select2 in a specific field:

    add_filter( 'um_extend_field_classes', 'um_121520_extend_field_classes', 10, 3);
    function um_121520_extend_field_classes( $classes, $key, $data ){
    
        if( $key == 'role_select' ){
            $classes = str_replace("um-s1", "", $classes);
        } 
        return $classes;
    }

    In the example above, it removes the select2 class um-s1 from the dropdown field with the meta/field key role_select.

    Regards,

Viewing 1 replies (of 1 total)
  • The topic ‘deactivate select2’ is closed to new replies.