/home/altere25/infinet.finance/wp-content/plugins/th-widget-pack/elements
Edit: /home/altere25/infinet.finance/wp-content/plugins/th-widget-pack/elements/header.php (47977B)
get_name();
}
protected function _register_controls() {
$this->start_controls_section(
'section_align',
[
'label' => __( 'Position', 'th-widget-pack' ),
]
);
$this->add_responsive_control(
'content_max_width',
[
'label' => __( 'Content Width', 'th-widget-pack' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 1000,
],
'%' => [
'min' => 0,
'max' => 100,
],
],
'size_units' => [ '%', 'px' ],
'default' => [
'size' => '100',
'unit' => '%',
],
'selectors' => [
'{{WRAPPER}} .th-header-wrap' => 'max-width: {{SIZE}}{{UNIT}};',
],
'dynamic' => [
'active' => true,
],
]
);
$this->add_responsive_control(
'header_horizontal_position',
[
'label' => __( 'Horizontal Position', 'th-widget-pack' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => __( 'Left', 'th-widget-pack' ),
'icon' => 'eicon-h-align-left',
],
'center' => [
'title' => __( 'Center', 'th-widget-pack' ),
'icon' => 'eicon-h-align-center',
],
'right' => [
'title' => __( 'Right', 'th-widget-pack' ),
'icon' => 'eicon-h-align-right',
],
],
'selectors' => [
'{{WRAPPER}} .th-header-wrap' => '{{VALUE}}',
],
'selectors_dictionary' => [
'left' => 'margin-right: auto; margin-left:0;',
'center' => 'margin: 0 auto',
'right' => 'margin-left: auto; margin-right:0;',
],
'default' => 'center',
]
);
$this->add_responsive_control(
'text_align',
[
'label' => __( 'Content Alignment', 'th-widget-pack' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'center',
'options' => [
'left' => [
'title' => __( 'Left', 'th-widget-pack' ),
'icon' => 'fa fa-align-left',
],
'center' => [
'title' => __( 'Center', 'th-widget-pack' ),
'icon' => 'fa fa-align-center',
],
'right' => [
'title' => __( 'Right', 'th-widget-pack' ),
'icon' => 'fa fa-align-right',
],
],
'selectors' => [
'{{WRAPPER}} .th-header-wrap .elementor-icon-box-wrapper' => 'text-align: {{VALUE}};',
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_icon',
[
'label' => __( 'Icon', 'th-widget-pack' ),
]
);
// $this->add_control(
// 'icon',
// [
// 'label' => __( 'Choose Icon', 'th-widget-pack' ),
// 'type' => Controls_Manager::ICON,
// 'options' => themo_icons(),
// 'include' => themo_fa_icons()
// ]
// );
$this->add_control(
'new_icon',
[
'label' => __( 'Choose Icon', 'th-widget-pack' ),
'fa4compatibility' => 'icon',
'type' => Controls_Manager::ICONS,
'label_block' => true,
/*'default' => [
'value' => 'fas fa-star',
'library' => 'fa-solid',
],*/
]
);
$this->add_control(
'view',
[
'label' => __( 'Style', 'th-widget-pack' ),
'type' => Controls_Manager::SELECT,
'options' => [
'default' => __( 'Default', 'th-widget-pack' ),
'stacked' => __( 'Filled', 'th-widget-pack' ),
'framed' => __( 'Framed', 'th-widget-pack' ),
],
'default' => 'default',
'prefix_class' => 'elementor-view-',
]
);
$this->add_control(
'shape',
[
'label' => __( 'Shape', 'th-widget-pack' ),
'type' => Controls_Manager::SELECT,
'options' => [
'circle' => __( 'Circle', 'th-widget-pack' ),
'square' => __( 'Square', 'th-widget-pack' ),
],
'default' => 'circle',
'condition' => [
'view!' => 'default',
],
'prefix_class' => 'elementor-shape-',
]
);
$this->add_control(
'icon_size',
[
'label' => __( 'Icon Size', 'th-widget-pack' ),
'type' => Controls_Manager::SELECT,
'options' => [
'sm' => __( 'Small', 'th-widget-pack' ),
'md' => __( 'Medium', 'th-widget-pack' ),
'lg' => __( 'Large', 'th-widget-pack' ),
'xl' => __( 'Extra Large', 'th-widget-pack' ),
],
'default' => 'lg',
]
);
$this->add_responsive_control(
'position',
[
'label' => __( 'Position', 'th-widget-pack' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'top',
'options' => [
'left' => [
'title' => __( 'Left', 'th-widget-pack' ),
'icon' => 'fa fa-align-left',
],
'top' => [
'title' => __( 'Top', 'th-widget-pack' ),
'icon' => 'fa fa-align-center',
],
'right' => [
'title' => __( 'Right', 'th-widget-pack' ),
'icon' => 'fa fa-align-right',
],
],
'prefix_class' => 'elementor-position%s-',
'toggle' => true,
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_title',
[
'label' => __( 'Title & Description', 'th-widget-pack' ),
]
);
$this->add_control(
'title_size',
[
'label' => __( 'Title HTML Tag', 'th-widget-pack' ),
'type' => Controls_Manager::SELECT,
'options' => [
'h1' => __( 'H1', 'th-widget-pack' ),
'h2' => __( 'H2', 'th-widget-pack' ),
'h3' => __( 'H3', 'th-widget-pack' ),
'h4' => __( 'H4', 'th-widget-pack' ),
'h5' => __( 'H5', 'th-widget-pack' ),
'h6' => __( 'H6', 'th-widget-pack' ),
],
'default' => 'h1',
'separator' => 'none',
]
);
$this->add_control(
'title_divider',
[
'label' => __( 'Title Divider', 'th-widget-pack' ),
'type' => Controls_Manager::SWITCHER,
'default' => '',
'label_on' => __( 'Show', 'th-widget-pack' ),
'label_off' => __( 'Hide', 'th-widget-pack' ),
'return_value' => 'yes',
/*'condition' => [
'title_size' => 'h2',
],*/
'separator' => 'none',
]
);
$this->add_control(
'title_text',
[
'label' => __( 'Title', 'th-widget-pack' ),
'type' => Controls_Manager::TEXT,
'default' => __( 'Title Text', 'th-widget-pack' ),
'placeholder' => __( 'Title Text', 'th-widget-pack' ),
'label_block' => true,
'dynamic' => [
'active' => true,
],
]
);
$this->add_control(
'description_text',
[
'label' => __( 'Description', 'th-widget-pack' ),
'type' => Controls_Manager::TEXTAREA,
'default' => __( 'Nulla eget tortor ac ipsum gravida sollicitudin vel aliquet ligula. Phasellus vitae nisi at risus euismod.', 'th-widget-pack' ),
'placeholder' => __( 'Your Description', 'th-widget-pack' ),
'title' => __( 'Input icon text here', 'th-widget-pack' ),
'rows' => 10,
'separator' => 'none',
'dynamic' => [
'active' => true,
],
]
);
$this->add_responsive_control(
'description_align',
[
'label' => __( 'Description Alignment', 'th-widget-pack' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => __( 'Left', 'th-widget-pack' ),
'icon' => 'fa fa-align-left',
],
'center' => [
'title' => __( 'Center', 'th-widget-pack' ),
'icon' => 'fa fa-align-center',
],
'right' => [
'title' => __( 'Right', 'th-widget-pack' ),
'icon' => 'fa fa-align-right',
],
],
'separator' => 'none',
'selectors' => [
'{{WRAPPER}} .elementor-icon-box-description' => 'text-align: {{VALUE}};',
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_buttons',
[
'label' => __( 'Buttons', 'th-widget-pack' ),
]
);
$this->add_control(
'button_1_heading',
[
'label' => __( 'Button 1', 'th-widget-pack' ),
'type' => Controls_Manager::HEADING,
]
);
$this->add_control(
'button_1_text',
[
'label' => __( 'Button Text', 'th-widget-pack' ),
'type' => Controls_Manager::TEXT,
'placeholder' => __( 'Button Text', 'th-widget-pack' ),
'dynamic' => [
'active' => true,
],
]
);
$this->add_control(
'button_1_style',
[
'label' => __( 'Button Style', 'th-widget-pack' ),
'type' => Controls_Manager::SELECT,
'default' => 'standard-primary',
'options' => [
'standard-primary' => __( 'Standard Primary', 'th-widget-pack' ),
'standard-accent' => __( 'Standard Accent', 'th-widget-pack' ),
'standard-light' => __( 'Standard Light', 'th-widget-pack' ),
'standard-dark' => __( 'Standard Dark', 'th-widget-pack' ),
'ghost-primary' => __( 'Ghost Primary', 'th-widget-pack' ),
'ghost-accent' => __( 'Ghost Accent', 'th-widget-pack' ),
'ghost-light' => __( 'Ghost Light', 'th-widget-pack' ),
'ghost-dark' => __( 'Ghost Dark', 'th-widget-pack' ),
'cta-primary' => __( 'CTA Primary', 'th-widget-pack' ),
'cta-accent' => __( 'CTA Accent', 'th-widget-pack' ),
],
]
);
$this->add_control(
'button_1_image',
[
'label' => __( 'Button Graphic', 'th-widget-pack' ),
'type' => Controls_Manager::MEDIA,
'default' => [
//'url' => Utils::get_placeholder_image_src(),
],
'dynamic' => [
'active' => true,
],
]
);
$this->add_control(
'button_1_link',
[
'label' => __( 'Link', 'th-widget-pack' ),
'type' => Controls_Manager::URL,
'placeholder' => __( '#buttonlink', 'th-widget-pack' ),
'dynamic' => [
'active' => true,
],
]
);
$this->add_control(
'button_2_heading',
[
'label' => __( 'Button 2', 'th-widget-pack' ),
'type' => Controls_Manager::HEADING,
]
);
$this->add_control(
'button_2_text',
[
'label' => __( 'Button Text', 'th-widget-pack' ),
'type' => Controls_Manager::TEXT,
'placeholder' => __( 'Button Text', 'th-widget-pack' ),
'dynamic' => [
'active' => true,
],
]
);
$this->add_control(
'button_2_style',
[
'label' => __( 'Button Style', 'th-widget-pack' ),
'type' => Controls_Manager::SELECT,
'default' => 'standard-primary',
'options' => [
'standard-primary' => __( 'Standard Primary', 'th-widget-pack' ),
'standard-accent' => __( 'Standard Accent', 'th-widget-pack' ),
'standard-light' => __( 'Standard Light', 'th-widget-pack' ),
'standard-dark' => __( 'Standard Dark', 'th-widget-pack' ),
'ghost-primary' => __( 'Ghost Primary', 'th-widget-pack' ),
'ghost-accent' => __( 'Ghost Accent', 'th-widget-pack' ),
'ghost-light' => __( 'Ghost Light', 'th-widget-pack' ),
'ghost-dark' => __( 'Ghost Dark', 'th-widget-pack' ),
'cta-primary' => __( 'CTA Primary', 'th-widget-pack' ),
'cta-accent' => __( 'CTA Accent', 'th-widget-pack' ),
],
]
);
$this->add_control(
'button_2_image',
[
'label' => __( 'Button Graphic', 'th-widget-pack' ),
'type' => Controls_Manager::MEDIA,
'default' => [
//'url' => Utils::get_placeholder_image_src(),
],
'dynamic' => [
'active' => true,
],
]
);
$this->add_control(
'button_2_link',
[
'label' => __( 'Link', 'th-widget-pack' ),
'type' => Controls_Manager::URL,
'placeholder' => __( '#buttonlink', 'th-widget-pack' ),
'dynamic' => [
'active' => true,
],
]
);
$this->add_responsive_control(
'button_align',
[
'label' => __( 'Alignment Override', 'th-widget-pack' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => __( 'Left', 'th-widget-pack' ),
'icon' => 'fa fa-align-left',
],
'center' => [
'title' => __( 'Center', 'th-widget-pack' ),
'icon' => 'fa fa-align-center',
],
'right' => [
'title' => __( 'Right', 'th-widget-pack' ),
'icon' => 'fa fa-align-right',
],
],
'separator' => 'none',
'selectors' => [
'{{WRAPPER}} .th-btn-wrap' => 'text-align: {{VALUE}};',
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_style_icon',
[
'label' => __( 'Icon', 'th-widget-pack' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'primary_color',
[
'label' => __( 'Primary Color', 'th-widget-pack' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}}.elementor-view-stacked .elementor-icon' => 'background-color: {{VALUE}};',
'{{WRAPPER}}.elementor-view-framed .elementor-icon, {{WRAPPER}}.elementor-view-default .elementor-icon' => 'color: {{VALUE}}; border-color: {{VALUE}};',
'{{WRAPPER}}.elementor-view-framed .elementor-icon svg, {{WRAPPER}}.elementor-view-default .elementor-icon svg' => 'fill: {{VALUE}}',
],
]
);
$this->add_control(
'secondary_color',
[
'label' => __( 'Secondary Color', 'th-widget-pack' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'condition' => [
'view!' => 'default',
],
'selectors' => [
'{{WRAPPER}}.elementor-view-framed .elementor-icon' => 'background-color: {{VALUE}};',
'{{WRAPPER}}.elementor-view-stacked .elementor-icon' => 'color: {{VALUE}};',
'{{WRAPPER}}.elementor-view-stacked .elementor-icon svg' => 'fill: {{VALUE}};',
],
]
);
$this->add_control(
'svg_title',
[
'label' => __( 'SVG Paths', 'th-widget-pack' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_control(
'icon_primary_path',
[
'label' => __( 'Primary Path', 'th-widget-pack' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}}.elementor-view-stacked .elementor-icon' => 'background-color: {{VALUE}};',
'{{WRAPPER}}.elementor-view-framed .elementor-icon, {{WRAPPER}}.elementor-view-default .elementor-icon' => 'color: {{VALUE}}; border-color: {{VALUE}};',
'{{WRAPPER}}.elementor-view-framed .elementor-icon svg path, {{WRAPPER}}.elementor-view-default .elementor-icon svg path' => 'fill: {{VALUE}};',
],
]
);
$this->add_control(
'icon_secondary_path',
[
'label' => __( 'Secondary Path', 'th-widget-pack' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'condition' => [
'view!' => 'default',
],
'selectors' => [
'{{WRAPPER}}.elementor-view-framed .elementor-icon' => 'background-color: {{VALUE}};',
'{{WRAPPER}}.elementor-view-stacked .elementor-icon svg path' => 'fill: {{VALUE}};',
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_style_content',
[
'label' => __( 'Content', 'th-widget-pack' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'heading_title',
[
'label' => __( 'Title', 'th-widget-pack' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_control(
'title_color',
[
'label' => __( 'Color', 'th-widget-pack' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .elementor-icon-box-content .elementor-icon-box-title' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'title_typography',
'selector' => '{{WRAPPER}} .elementor-icon-box-content .elementor-icon-box-title',
]
);
$this->add_group_control(
Group_Control_Text_Shadow::get_type(),
[
'name' => 'title_shadow',
'selector' => '{{WRAPPER}} .elementor-icon-box-content .elementor-icon-box-title',
]
);
$this->add_control(
'thmv_section_divider_heading',
[
'label' => __('Divider', 'elementor'),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
'condition' => [
'title_divider' => 'yes'
],
]
);
$this->add_control(
'divider_color',
[
'label' => __( 'Color', 'th-widget-pack' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .th-header-wrap .th-header-divider' => 'border-color: {{VALUE}};',
],
'condition' => [
'title_divider' => 'yes',
],
]
);
//if(defined('THEMO_CURRENT_THEME') && 'bellevue' == THEMO_CURRENT_THEME) {
$this->add_responsive_control(
'thmv_divider_size',
[
'label' => __('Width', 'elementor'),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px', '%'],
'range' => [
'px' => [
'min' => 1,
'max' => 1140,
'step' => 5,
],
'%' => [
'min' => 1,
'max' => 100,
],
],
'selectors' => [
'{{WRAPPER}} .th-header-wrap .th-header-divider' => 'width: {{SIZE}}{{UNIT}};',
],
'condition' => [
'title_divider' => 'yes'
],
]
);
$this->add_responsive_control(
'thmv_divider_height',
[
'label' => __('Height', 'elementor'),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 1,
'max' => 20,
'step' => 1,
],
],
'selectors' => [
'{{WRAPPER}} .th-header-wrap .th-header-divider' => 'border-width: {{SIZE}}{{UNIT}};',
],
'condition' => [
'title_divider' => 'yes'
],
]
);
$this->add_responsive_control(
'thmv_divider_radius',
[
'label' => __('Corner Radius', 'elementor'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px'],
'selectors' => [
'{{WRAPPER}} .th-header-wrap .th-header-divider' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'thmv_divider_spacing',
[
'label' => __('Spacing', 'elementor'),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 1,
'max' => 30,
'step' => 1,
],
],
'selectors' => [
'{{WRAPPER}} .th-header-wrap .th-header-divider' => 'margin-top: {{SIZE}}{{UNIT}}; margin-bottom: {{SIZE}}{{UNIT}};',
],
'condition' => [
'title_divider' => 'yes'
],
]
);
//}
$this->add_control(
'heading_description',
[
'label' => __( 'Description', 'th-widget-pack' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_control(
'description_color',
[
'label' => __( 'Color', 'th-widget-pack' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .elementor-icon-box-content .elementor-icon-box-description' => 'color: {{VALUE}};',
'{{WRAPPER}} .elementor-icon-box-content .elementor-icon-box-description a' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'description_typography',
'selector' => '{{WRAPPER}} .elementor-icon-box-content .elementor-icon-box-description',
]
);
//if(defined('THEMO_CURRENT_THEME') && 'bellevue' == THEMO_CURRENT_THEME) {
$this->add_control(
'heading_span',
[
'label' => __('Span', 'th-widget-pack'),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
'description' => 'HELLO this is some text.'
]
);
$this->add_control(
'span_note',
[
//'label' => __( 'Note', 'th-widget-pack' ),
'type' => Controls_Manager::RAW_HTML,
'raw' => __( '
Span tags can be added to Title and Description for additional styling. E.G.: My title has <span>blue text</span>.
', 'th-widget-pack' ),
'content_classes' => 'themo-elem-html-control',
]
);
$this->add_control(
'span_color',
[
'label' => __('Color', 'th-widget-pack'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .elementor-icon-box-content .elementor-icon-box-title span' => 'color: {{VALUE}};',
'{{WRAPPER}} .elementor-icon-box-content .elementor-icon-box-description span' => 'color: {{VALUE}};',
'{{WRAPPER}} .elementor-icon-box-content .elementor-icon-box-description a span' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'span_typography',
'selector' => '{{WRAPPER}} .elementor-icon-box-content .elementor-icon-box-title span,
{{WRAPPER}} .elementor-icon-box-content .elementor-icon-box-description span,
{{WRAPPER}} .elementor-icon-box-content .elementor-icon-box-description span a',
]
);
$this->add_control(
'section_button_1_heading',
[
'label' => __( 'Button 1', 'elementor' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_control(
'button_1_text_color',
[
'label' => __( 'Text Color', 'th-widget-pack' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .th-btn-wrap .btn-1' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'label' => __( 'Typography', 'elementor' ),
'name' => 'section_button_1_typography',
'selector' => '{{WRAPPER}} .th-btn-wrap .btn-1',
]
);
$this->add_responsive_control(
'section_button_1_padding',
[
'label' => __( 'Padding', 'elementor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [
'{{WRAPPER}} .th-btn-wrap .btn-1' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_control(
'section_button_2_heading',
[
'label' => __( 'Button 2', 'elementor' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_control(
'button_2_text_color',
[
'label' => __( 'Text Color', 'th-widget-pack' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .th-btn-wrap .btn-2' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'label' => __( 'Typography', 'elementor' ),
'name' => 'section_button_2_typography',
'selector' => '{{WRAPPER}} .th-btn-wrap .btn-2',
]
);
$this->add_responsive_control(
'section_button_2_padding',
[
'label' => __( 'Padding', 'elementor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [
'{{WRAPPER}} .th-btn-wrap .btn-2' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
//}
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
$elm_animation = false;
if ( ! empty( $settings['hover_animation'] ) ) {
$elm_animation = 'elementor-animation-' . esc_attr( $settings['hover_animation'] );
}
$this->add_render_attribute( 'icon', 'class', ['elementor-icon', $elm_animation] );
$icon_tag = 'span';
/*if ( ! empty( $settings['link']['url'] ) ) {
$this->add_render_attribute( 'link', 'href', esc_url( $settings['link']['url'] ) );
$icon_tag = 'a';
if ( ! empty( $settings['link']['is_external'] ) ) {
$this->add_render_attribute( 'link', 'target', '_blank' );
}
}*/
$this->add_render_attribute( 'th-icon-size', 'class', 'elementor-icon-box-icon' );
$this->add_render_attribute( 'th-icon-size', 'class', 'th-icon-size-' . esc_attr( $settings['icon_size'] ) );
$icon_attributes = $this->get_render_attribute_string( 'icon' );
//$link_attributes = $this->get_render_attribute_string( 'link' );
// BUTTON 1
// Graphic Button
$button_1_image = false;
if ( isset( $settings['button_1_image']['id'] ) && $settings['button_1_image']['id'] > "" ) {
$button_1_image = wp_get_attachment_image( $settings['button_1_image']['id'], "th_img_xs", false, array( 'class' => '' ) );
}elseif ( ! empty( $settings['button_1_image']['url'] ) ) {
$this->add_render_attribute( 'button_1_image', 'src', esc_url( $settings['button_1_image']['url'] ) );
$this->add_render_attribute( 'button_1_image', 'alt', esc_attr( Control_Media::get_image_alt( $settings['button_1_image'] ) ) );
$this->add_render_attribute( 'button_1_image', 'title', esc_attr( Control_Media::get_image_title( $settings['button_1_image'] ) ) );
$button_1_image = '
![]()
get_render_attribute_string( 'button_1_image' ) . '>';
}
// Graphic Button URL Styling
if ( isset($button_1_image) && ! empty( $button_1_image ) ) {
// image button
$this->add_render_attribute( 'btn-1-link', 'class', 'btn-1' );
$this->add_render_attribute( 'btn-1-link', 'class', 'th-btn' );
$this->add_render_attribute( 'btn-1-link', 'class', 'btn-image' );
}else{ // Bootstrap Button URL Styling
$this->add_render_attribute( 'btn-1-link', 'class', 'btn-1' );
$this->add_render_attribute( 'btn-1-link', 'class', 'btn' );
$this->add_render_attribute( 'btn-1-link', 'class', 'th-btn' );
$this->add_render_attribute( 'btn-1-link', 'class', 'btn-' . esc_attr( $settings['button_1_style'] ) );
}
// Button URL
if ( empty( $settings['button_1_link']['url'] ) ) { $settings['button_1_link']['url'] = '#'; };
if ( ! empty( $settings['button_1_link']['url'] ) ) {
$this->add_render_attribute( 'btn-1-link', 'href', esc_url( $settings['button_1_link']['url'] ) );
if ( ! empty( $settings['button_1_link']['is_external'] ) ) {
$this->add_render_attribute( 'btn-1-link', 'target', '_blank' );
}
}
// BUTTON 2
// Graphic Button
$button_2_image = false;
if ( isset( $settings['button_2_image']['id'] ) && $settings['button_2_image']['id'] > "" ) {
$button_2_image = wp_get_attachment_image( $settings['button_2_image']['id'], "th_img_xs", false, array( 'class' => '' ) );
}elseif ( ! empty( $settings['button_2_image']['url'] ) ) {
$this->add_render_attribute( 'button_2_image', 'src', esc_url( $settings['button_2_image']['url'] ) );
$this->add_render_attribute( 'button_2_image', 'alt', esc_attr( Control_Media::get_image_alt( $settings['button_2_image'] ) ) );
$this->add_render_attribute( 'button_2_image', 'title', esc_attr( Control_Media::get_image_title( $settings['button_2_image'] ) ) );
$button_1_image = '
![]()
get_render_attribute_string( 'button_2_image' ) . '>';
}
// Graphic Button URL Styling
if ( isset($button_2_image) && ! empty( $button_2_image ) ) {
// image button
$this->add_render_attribute( 'btn-2-link', 'class', 'btn-2' );
$this->add_render_attribute( 'btn-2-link', 'class', 'th-btn' );
$this->add_render_attribute( 'btn-2-link', 'class', 'btn-image' );
}else{ // Bootstrap Button URL Styling
$this->add_render_attribute( 'btn-2-link', 'class', 'btn-2' );
$this->add_render_attribute( 'btn-2-link', 'class', 'btn' );
$this->add_render_attribute( 'btn-2-link', 'class', 'th-btn' );
$this->add_render_attribute( 'btn-2-link', 'class', 'btn-' . esc_attr( $settings['button_2_style'] ) );
}
// Button URL
if ( empty( $settings['button_2_link']['url'] ) ) { $settings['button_2_link']['url'] = '#'; };
if ( ! empty( $settings['button_2_link']['url'] ) ) {
$this->add_render_attribute( 'btn-2-link', 'href', esc_url( $settings['button_2_link']['url'] ) );
if ( ! empty( $settings['button_2_link']['is_external'] ) ) {
$this->add_render_attribute( 'btn-2-link', 'target', '_blank' );
}
}
$this->add_render_attribute( 'th-header-class', 'class', 'elementor-icon-box-title' );
// Divider & Alignment Class
if ( isset($settings['title_divider']) && 'yes' == $settings['title_divider'] ) {
$this->add_render_attribute( 'th_divider_span', 'class', 'th-header-divider' );
}
?>
<#
iconHTML = elementor.helpers.renderIcon( view, settings.new_icon, { 'aria-hidden': true }, 'i' , 'object' );
migrated = elementor.helpers.isIconMigrated( settings, 'new_icon' );
var link = '',
iconTag = 'span';
icon_size = '';
icon_show = '';
var th_divder_span = '';
var th_header_class = 'elementor-icon-box-title';
// Divider & Alignment Class
if ( settings.title_divider && 'yes' == settings.title_divider ) {
var th_divder_span = "";
}
if ( settings.icon_size ) { var icon_size = 'th-icon-size-'+settings.icon_size }
if ( settings.icon || settings.new_icon) { var icon_show = 'th-show-icon'}
#>
get_name() ] = [
'conditions' => [ 'widgetType' => $this->get_name() ],
'fields' => [
[
'field' => 'title_text',
'type' => __( 'Title Text', 'th-widget-pack' ),
'editor_type' => 'LINE'
],
[
'field' => 'description_text',
'type' => __( 'Description Text', 'th-widget-pack' ),
'editor_type' => 'AREA'
],
[
'field' => 'button_1_text',
'type' => __( 'Button Text', 'th-widget-pack' ),
'editor_type' => 'LINE'
],
'button_1_link' => [
'field' => 'url',
'field_id' => 'button_1_link', // New key
'type' => __('Button URL 1', 'th-widget-pack'),
'editor_type' => 'LINK' // Or 'LINK' but then relative links won't work
],
[
'field' => 'button_2_text',
'type' => __( 'Button Text', 'th-widget-pack' ),
'editor_type' => 'LINE'
],
'button_2_link' => [
'field' => 'url',
'field_id' => 'button_2_link', // New key
'type' => __('Button URL 2', 'th-widget-pack'),
'editor_type' => 'LINK' // Or 'LINK' but then relative links won't work
],
],
];
return $widgets;
}
}
Plugin::instance()->widgets_manager->register_widget_type( new Themo_Widget_Header() );