• Resolved wpstream

    (@wpstream)


    I’m trying to get a Select control to have as options the data from another control. This is my code

    
    $property_types = array(
                'type1_slug'=>'type1_label',
                'type2_slug'=>'type2_label',
                'type3_slug'=>'type3_label',
                'type4_slug'=>'type4_label',
                'type5_slug'=>'type5_label',
            );
    
    $this->add_control(
                    'type_data',
                    [
                        'label'     => esc_html__( 'Select Types', 'elementor' ),
                        'type'      => Controls_Manager::SELECT2,
                        'options'   => $property_types,
                        'description' => '',
                        'multiple' => true,
                        'label_block' => true,
                        'default' => '',
                       
                    ]
                );
    ///////// a repeater is defined....
    
    $repeater = new Repeater();
    $repeater->add_control(
                    'tab_holder', [
                        'label' => esc_html__('select Tabs', 'elementor'),
                        'type' => Controls_Manager::SELECT,
                        'options' => '' ,
                        'default' => 'type1_slug',
                    ]
            );

    What I’m trying to do is to have as options in “tab_holder” the values i selected in “type_data”. Is this possible ?

The topic ‘Dynamic data as option value for Elementor controls’ is closed to new replies.