/home/techb158/public_html/wp-content/themes/engitech/inc/backend/elementor-widgets
Edit: /home/techb158/public_html/wp-content/themes/engitech/inc/backend/elementor-widgets/switcher.php (5182B)
start_controls_section(
'content_section',
[
'label' => __( 'Switcher', 'engitech' ),
]
);
$this->add_responsive_control(
'align',
[
'label' => __( 'Alignment', 'engitech' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => __( 'Left', 'engitech' ),
'icon' => 'eicon-text-align-left',
],
'center' => [
'title' => __( 'Center', 'engitech' ),
'icon' => 'eicon-text-align-center',
],
'right' => [
'title' => __( 'Right', 'engitech' ),
'icon' => 'eicon-text-align-right',
],
],
// 'prefix_class' => 'engitech%s-align-',
'selectors' => [
'{{WRAPPER}} .ot-switcher' => 'text-align: {{VALUE}};',
],
]
);
$this->add_control(
'title_left',
[
'label' => __( 'Title Left', 'engitech' ),
'type' => Controls_Manager::TEXT,
'default' => __( 'Monthly', 'engitech' ),
'label_block' => true,
]
);
$this->add_control(
'title_right',
[
'label' => __( 'Title Right', 'engitech' ),
'type' => Controls_Manager::TEXT,
'default' => __( 'Yearly', 'engitech' ),
'label_block' => true,
]
);
$this->end_controls_section();
//Styling
$this->start_controls_section(
'style_icon_section',
[
'label' => __( 'Switcher', 'engitech' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
//Title
$this->add_control(
'heading_title',
[
'label' => __( 'Title', 'engitech' ),
'type' => Controls_Manager::HEADING,
]
);
$this->add_responsive_control(
'title_space',
[
'label' => __( 'Spacing', 'engitech' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 100,
],
],
'selectors' => [
'{{WRAPPER}} .switch' => 'margin-left: {{SIZE}}{{UNIT}}; margin-right: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_control(
'title_color',
[
'label' => __( 'Color', 'engitech' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .ot-switcher > span' => 'color: {{VALUE}};',
]
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'title_typography',
'selector' => '{{WRAPPER}} .ot-switcher > span',
]
);
$this->end_controls_tabs();
//Title
$this->add_control(
'heading_toggle',
[
'label' => __( 'Toggle', 'engitech' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_control(
'toggle_bg',
[
'label' => __( 'Background', 'engitech' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .slider' => 'background: {{VALUE}};',
]
]
);
$this->add_control(
'toggle_color',
[
'label' => __( 'Color', 'engitech' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .slider:before' => 'background: {{VALUE}};',
]
]
);
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
?>
widgets_manager->register_widget_type( new Engitech_Switcher() );