start_controls_section( 'section_divider_query', [ 'label' => __( 'Icon Divider', 'attesa-extra' ), ] ); $this->add_control( 'style', [ 'label' => __( 'Style', 'attesa-extra' ), 'type' => Controls_Manager::SELECT, 'default' => 'solid', 'options' => [ 'solid' => __( 'Solid', 'attesa-extra' ), 'double' => __( 'Double', 'attesa-extra' ), 'dotted' => __( 'Dotted', 'attesa-extra' ), 'dashed' => __( 'Dashed', 'attesa-extra' ), ], 'selectors' => [ '{{WRAPPER}} .attesa-extra-divider-wrap .attesa-extra-divider' => 'border-top-style: {{VALUE}};', ], ] ); $this->add_control( 'weight', [ 'label' => __( 'Weight', 'attesa-extra' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 2, ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 50, 'step' => 1, ], ], 'selectors' => [ '{{WRAPPER}} .attesa-extra-divider-wrap .attesa-extra-divider' => 'border-top-width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'color', [ 'label' => __( 'Color', 'attesa-extra' ), 'type' => Controls_Manager::COLOR, 'default' => '#000000', 'selectors' => [ '{{WRAPPER}} .attesa-extra-divider-wrap .attesa-extra-divider' => 'border-top-color: {{VALUE}};', '{{WRAPPER}} .attesa-extra-divider-wrap .attesa-divider-middle' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'icon_align', [ 'label' => __( 'Alignment', 'attesa-extra' ), 'type' => Controls_Manager::SELECT, 'default' => 'position_center', 'options' => [ 'position_left' => __( 'Left', 'attesa-extra' ), 'position_center' => __( 'Center', 'attesa-extra' ), 'position_right' => __( 'Right', 'attesa-extra' ), ], ] ); $this->add_responsive_control( 'width', [ 'label' => __( 'Width', 'attesa-extra' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'default' => [ 'size' => 100, 'unit' => '%', ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1000, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, 'step' => 1, ], ], 'condition' => [ 'icon_align' => 'position_center', ], 'selectors' => [ '{{WRAPPER}} .attesa-extra-divider-wrap' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'gap', [ 'label' => __( 'Gap', 'attesa-extra' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 15, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 50, 'step' => 1, ], ], 'selectors' => [ '{{WRAPPER}} .attesa-extra-divider-wrap' => 'padding: {{SIZE}}{{UNIT}} 0;', ], ] ); $this->add_control( 'icon', [ 'label' => __( 'Icon', 'attesa-extra' ), 'type' => Controls_Manager::ICON, 'default' => 'fa fa-bolt', ] ); $this->add_control( 'icon-size', [ 'label' => __( 'Icon Size', 'attesa-extra' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 20, ], 'range' => [ 'px' => [ 'min' => 5, 'max' => 100, 'step' => 1, ], ], 'selectors' => [ '{{WRAPPER}} .attesa-extra-divider-wrap .attesa-divider-middle' => 'font-size: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'icon-padding', [ 'label' => __( 'Icon Padding', 'attesa-extra' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 10, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1, ], ], 'selectors' => [ '{{WRAPPER}} .attesa-extra-divider-wrap .attesa-divider-middle' => 'padding: 0 {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'view', [ 'label' => __( 'View', 'attesa-extra' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'traditional', ] ); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings(); $icon = $settings['icon']; $align = $settings['icon_align']; ?>