Widget_Icon_List::_register_controls()
Register icon list widget controls.
Description
Adds different input fields to allow the user to change and customize the widget settings.
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |
Source
includes/widgets/icon-list.php
'title' => __( 'Default', 'elementor' ), 'icon' => 'eicon-editor-list-ul', ], 'inline' => [ 'title' => __( 'Inline', 'elementor' ), 'icon' => 'eicon-ellipsis-h', ], ], 'render_type' => 'template', 'classes' => 'elementor-control-start-end', 'label_block' => false, ] ); $this->add_control( 'icon_list', [ 'label' => '', 'type' => Controls_Manager::REPEATER, 'default' => [ [ 'text' => __( 'List Item #1', 'elementor' ), 'icon' => 'fa fa-check', ], [ 'text' => __( 'List Item #2', 'elementor' ), 'icon' => 'fa fa-times', ], [ 'text' => __( 'List Item #3', 'elementor' ), 'icon' => 'fa fa-dot-circle-o', ], ], 'fields' => [ [ 'name' => 'text', 'label' => __( 'Text', 'elementor' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'placeholder' => __( 'List Item', 'elementor' ), 'default' => __( 'List Item', 'elementor' ), ], [ 'name' => 'icon', 'label' => __( 'Icon', 'elementor' ), 'type' => Controls_Manager::ICON, 'label_block' => true, 'default' => 'fa fa-check', ], [ 'name' => 'link', 'label' => __( 'Link', 'elementor' ), 'type' => Controls_Manager::URL, 'label_block' => true, 'placeholder' => __( 'https://your-link.com', 'elementor' ), ], ], 'title_field' => '<i class="{{ icon }}" aria-hidden="true"></i> {{{ text }}}', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_icon_list', [ 'label' => __( 'List', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'space_between', [ 'label' => __( 'Space Between', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'max' => 50, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-items:not(.elementor-grid) .elementor-icon-list-item:not(:last-child)' => 'padding-bottom: calc({{SIZE}}{{UNIT}}/2)', '{{WRAPPER}} .elementor-icon-list-items:not(.elementor-grid) .elementor-icon-list-item:not(:first-child)' => 'margin-top: calc({{SIZE}}{{UNIT}}/2)', '{{WRAPPER}} .elementor-icon-list-items.elementor-grid .elementor-icon-list-item' => 'margin-right: calc({{SIZE}}{{UNIT}}/2); margin-left: calc({{SIZE}}{{UNIT}}/2)', '{{WRAPPER}} .elementor-icon-list-items.elementor-grid' => 'margin-right: calc(-{{SIZE}}{{UNIT}}/2); margin-left: calc(-{{SIZE}}{{UNIT}}/2)', ], ] ); $this->add_responsive_control( 'icon_align', [ 'label' => __( 'Alignment', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'elementor' ), 'icon' => 'eicon-h-align-left', ], 'center' => [ 'title' => __( 'Center', 'elementor' ), 'icon' => 'eicon-h-align-center', ], 'right' => [ 'title' => __( 'Right', 'elementor' ), 'icon' => 'eicon-h-align-right', ], ], 'prefix_class' => 'elementor%s-align-', 'classes' => 'elementor-control-start-end', ] ); $this->add_control( 'divider', [ 'label' => __( 'Divider', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_off' => __( 'Off', 'elementor' ), 'label_on' => __( 'On', 'elementor' ), 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-item:not(:last-child):after' => 'content: ""', ], 'separator' => 'before', ] ); $this->add_control( 'divider_style', [ 'label' => __( 'Style', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'solid' => __( 'Solid', 'elementor' ), 'double' => __( 'Double', 'elementor' ), 'dotted' => __( 'Dotted', 'elementor' ), 'dashed' => __( 'Dashed', 'elementor' ), ], 'default' => 'solid', 'condition' => [ 'divider' => 'yes', ], 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-item:not(:last-child):after' => 'border-top-style: {{VALUE}};', ], ] ); $this->add_control( 'divider_weight', [ 'label' => __( 'Weight', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 1, ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 10, ], ], 'condition' => [ 'divider' => 'yes', ], 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-item:not(:last-child):after' => 'border-top-width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'divider_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '#ddd', 'scheme' => [ 'type' => Scheme_Color::get_type(), 'value' => Scheme_Color::COLOR_3, ], 'condition' => [ 'divider' => 'yes', ], 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-item:not(:last-child):after' => 'border-top-color: {{VALUE}};', ], ] ); $this->add_control( 'divider_width', [ 'label' => __( 'Width', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'units' => [ '%' ], 'default' => [ 'unit' => '%', ], 'condition' => [ 'divider' => 'yes', ], 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-item:not(:last-child):after' => 'width: {{SIZE}}{{UNIT}}', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_icon_style', [ 'label' => __( 'Icon', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'icon_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-icon i' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => Scheme_Color::get_type(), 'value' => Scheme_Color::COLOR_1, ], ] ); $this->add_control( 'icon_color_hover', [ 'label' => __( 'Hover', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-item:hover .elementor-icon-list-icon i' => 'color: {{VALUE}};', ], ] ); $this->add_responsive_control( 'icon_size', [ 'label' => __( 'Size', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 14, ], 'range' => [ 'px' => [ 'min' => 6, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-icon' => 'width: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .elementor-icon-list-icon i' => 'font-size: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_text_style', [ 'label' => __( 'Text', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'text_color', [ 'label' => __( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-text' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => Scheme_Color::get_type(), 'value' => Scheme_Color::COLOR_2, ], ] ); $this->add_control( 'text_color_hover', [ 'label' => __( 'Hover', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-item:hover .elementor-icon-list-text' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'text_indent', [ 'label' => __( 'Text Indent', 'elementor' ),
Uses
- includes/controls/groups/typography.php: Group_Control_Typography::get_type()
- includes/elements/repeater.php: Repeater::add_control()
- includes/elements/repeater.php: Repeater::__construct()
- includes/schemes/color.php: Scheme_Color::get_type()