Answers for "elementor field conditional logic"

0

elementor field conditional logic

$this->add_control(
    'icon_as',
    [
        'label'        => __( 'Icon as', 'ic-core' ),
        'type'         => Controls_Manager::SWITCHER,
        'label_on'     => __( 'icon', 'ic-core' ),
        'label_off'    => __( 'image', 'ic-core' ),
        'return_value' => 'yes',
        'default'      => 'yes',
    ]
);

$this->add_control(
    'icon',
    array(
        'label'     => __( 'Icon', 'ic-core' ),
        'type'      => Controls_Manager::ICONS,
        'default'   => [
            'value'   => 'fa fa-star',
            'library' => 'regular',
        ],
        'condition' => [
            'icon_as' => [ 'yes' ],
        ],
    )
);
Posted by: Guest on October-12-2021

Browse Popular Code Answers by Language