How can I add bulk options to dropdown form field

Home Forums Plugin Support How can I add bulk options to dropdown form field

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Khaled 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8375

    Dear Team,

    I am using User-Meta plugin(Version 1.3). I need to create a dropdown form field with nearly 7000 option values. How can I do this ?

    #8376

    Khaled
    Keymaster

    Hello Sasi,

    You can do that by programmatically. Write something similar to your functions.php

    
    add_filter('user_meta_field_config', function ($field, $fieldID, $formName) {
        if ($fieldID != 'Your field id here')
            return $field;
        
        $field['options'] = [
            'options_1',
            'options_2',
            'options_3'
        ];
        
        return $field;
    }, 10, 3);
    

    Thanks
    Khaled

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

You must be logged in to reply to this topic.

Subscribe to our newsletter