File: /home/todorterziev/public_html/wp-content/plugins/element-helper/widgets/member/member-widget.php
<?php
namespace ElementHelper\Widget;
use \Elementor\Group_Control_Text_Shadow;
use \Elementor\Repeater;
use \Elementor\Core\Schemes\Typography;
use \Elementor\Utils;
use \Elementor\Control_Media;
use \Elementor\Controls_Manager;
use \Elementor\Group_Control_Border;
use \Elementor\Group_Control_Box_Shadow;
use \Elementor\Group_Control_Image_Size;
use \Elementor\Group_Control_Typography;
use \Elementor\Group_Control_Css_Filter;
defined( 'ABSPATH' ) || die();
class Member extends Element_El_Widget {
/**
* Get widget name.
*
* Retrieve Element Helper widget name.
*
* @since 1.0.0
* @access public
*
* @return string Widget name.
*/
public function get_name() {
return 'team_member';
}
/**
* Get widget title.
*
* @since 1.0.0
* @access public
*
* @return string Widget title.
*/
public function get_title() {
return __( 'Team Member', 'elementhelper' );
}
public function get_custom_help_url() {
return '';
}
/**
* Get widget icon.
*
* @since 1.0.0
* @access public
*
* @return string Widget icon.
*/
public function get_icon() {
return 'elh-widget-icon eicon-lock-user';
}
public function get_keywords() {
return [ 'team', 'member', 'crew', 'staff', 'person' ];
}
protected static function get_profile_names() {
return [
'fal fa-comments' => __( 'Comments', 'elementhelper' ),
'apple' => __( 'Apple', 'elementhelper' ),
'behance' => __( 'Behance', 'elementhelper' ),
'bitbucket' => __( 'BitBucket', 'elementhelper' ),
'codepen' => __( 'CodePen', 'elementhelper' ),
'delicious' => __( 'Delicious', 'elementhelper' ),
'deviantart' => __( 'DeviantArt', 'elementhelper' ),
'digg' => __( 'Digg', 'elementhelper' ),
'dribbble' => __( 'Dribbble', 'elementhelper' ),
'email' => __( 'Email', 'elementhelper' ),
'facebook' => __( 'Facebook', 'elementhelper' ),
'flickr' => __( 'Flicker', 'elementhelper' ),
'foursquare' => __( 'FourSquare', 'elementhelper' ),
'github' => __( 'Github', 'elementhelper' ),
'houzz' => __( 'Houzz', 'elementhelper' ),
'instagram' => __( 'Instagram', 'elementhelper' ),
'jsfiddle' => __( 'JS Fiddle', 'elementhelper' ),
'linkedin' => __( 'LinkedIn', 'elementhelper' ),
'medium' => __( 'Medium', 'elementhelper' ),
'pinterest' => __( 'Pinterest', 'elementhelper' ),
'product-hunt' => __( 'Product Hunt', 'elementhelper' ),
'reddit' => __( 'Reddit', 'elementhelper' ),
'slideshare' => __( 'Slide Share', 'elementhelper' ),
'snapchat' => __( 'Snapchat', 'elementhelper' ),
'soundcloud' => __( 'SoundCloud', 'elementhelper' ),
'spotify' => __( 'Spotify', 'elementhelper' ),
'stack-overflow' => __( 'StackOverflow', 'elementhelper' ),
'tripadvisor' => __( 'TripAdvisor', 'elementhelper' ),
'tumblr' => __( 'Tumblr', 'elementhelper' ),
'twitch' => __( 'Twitch', 'elementhelper' ),
'twitter' => __( 'Twitter', 'elementhelper' ),
'vimeo' => __( 'Vimeo', 'elementhelper' ),
'vk' => __( 'VK', 'elementhelper' ),
'website' => __( 'Website', 'elementhelper' ),
'whatsapp' => __( 'WhatsApp', 'elementhelper' ),
'wordpress' => __( 'WordPress', 'elementhelper' ),
'xing' => __( 'Xing', 'elementhelper' ),
'yelp' => __( 'Yelp', 'elementhelper' ),
'youtube' => __( 'YouTube', 'elementhelper' ),
];
}
/**
* Register content related controls
*/
protected function register_content_controls() {
$this->start_controls_section(
'_section_info',
[
'label' => __( 'Information', 'elementhelper' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'image',
[
'label' => __( 'Photo', 'elementhelper' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
'dynamic' => [
'active' => true,
]
]
);
$this->add_group_control(
Group_Control_Image_Size::get_type(),
[
'name' => 'thumbnail',
'default' => 'large',
'separator' => 'none',
]
);
$this->add_control(
'title',
[
'label' => __( 'Name', 'elementhelper' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'default' => 'Happy Member Name',
'placeholder' => __( 'Type Member Name', 'elementhelper' ),
'separator' => 'before',
'dynamic' => [
'active' => true,
]
]
);
$this->add_control(
'job_title',
[
'label' => __( 'Job Title', 'elementhelper' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'default' => __( 'Happy Officer', 'elementhelper' ),
'placeholder' => __( 'Type Member Job Title', 'elementhelper' ),
'dynamic' => [
'active' => true,
]
]
);
$this->add_control(
'team_url',
[
'label' => __( 'Link', 'elementhelper' ),
'type' => Controls_Manager::URL,
'placeholder' => __( 'http://elementor.sabber.com', 'elementhelper' ),
'dynamic' => [
'active' => true,
],
'default' => [
'url' => '',
'is_external' => true,
'nofollow' => true,
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'_section_social',
[
'label' => __( 'Social Profiles', 'elementhelper' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$repeater = new Repeater();
$repeater->add_control(
'name',
[
'label' => __( 'Profile Name', 'elementhelper' ),
'type' => Controls_Manager::SELECT2,
'label_block' => true,
'select2options' => [
'allowClear' => false,
],
'options' => self::get_profile_names()
]
);
$repeater->add_control(
'link', [
'label' => __( 'Profile Link', 'elementhelper' ),
'placeholder' => __( 'Add your profile link', 'elementhelper' ),
'type' => Controls_Manager::URL,
'label_block' => true,
'autocomplete' => false,
'show_external' => false,
'condition' => [
'name!' => 'email'
],
'dynamic' => [
'active' => true,
]
]
);
$this->add_control(
'profiles',
[
'show_label' => false,
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'title_field' => '<# print(name.slice(0,1).toUpperCase() + name.slice(1)) #>',
'default' => [
[
'link' => ['url' => 'https://facebook.com/'],
'name' => 'facebook'
],
[
'link' => ['url' => 'https://twitter.com/'],
'name' => 'twitter'
],
[
'link' => ['url' => 'https://linkedin.com/'],
'name' => 'linkedin'
]
],
]
);
$this->add_control(
'show_profiles',
[
'label' => __( 'Show Profiles', 'elementhelper' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Show', 'elementhelper' ),
'label_off' => __( 'Hide', 'elementhelper' ),
'return_value' => 'yes',
'default' => 'yes',
'separator' => 'before',
'style_transfer' => true,
]
);
$this->end_controls_section();
$this->start_controls_section(
'_section_button',
[
'label' => __( 'Button', 'elementhelper' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'button_text',
[
'label' => __( 'Text', 'elementhelper' ),
'type' => Controls_Manager::TEXT,
'default' => 'Button Text',
'placeholder' => __( 'Type button text here', 'elementhelper' ),
'label_block' => true,
'dynamic' => [
'active' => true,
]
]
);
$this->add_control(
'button_link',
[
'label' => __( 'Link', 'elementhelper' ),
'type' => Controls_Manager::URL,
'placeholder' => 'http://elementor.sabber.com/',
'dynamic' => [
'active' => true,
]
]
);
if ( elh_element_is_elementor_version( '<', '2.6.0' ) ) {
$this->add_control(
'button_icon',
[
'label' => __( 'Icon', 'elementhelper' ),
'label_block' => true,
'type' => Controls_Manager::ICON,
'options' => elh_element_get_elh_element_icons(),
'default' => 'fa fa-angle-right',
]
);
$condition = ['button_icon!' => ''];
} else {
$this->add_control(
'button_selected_icon',
[
'type' => Controls_Manager::ICONS,
'fa4compatibility' => 'button_icon',
'label_block' => true,
]
);
$condition = ['button_selected_icon[value]!' => ''];
}
$this->add_control(
'button_icon_position',
[
'label' => __( 'Icon Position', 'elementhelper' ),
'type' => Controls_Manager::CHOOSE,
'label_block' => false,
'options' => [
'before' => [
'title' => __( 'Before', 'elementhelper' ),
'icon' => 'eicon-h-align-left',
],
'after' => [
'title' => __( 'After', 'elementhelper' ),
'icon' => 'eicon-h-align-right',
],
],
'default' => 'before',
'toggle' => false,
'condition' => $condition,
'style_transfer' => true,
]
);
$this->add_control(
'button_icon_spacing',
[
'label' => __( 'Icon Spacing', 'elementhelper' ),
'type' => Controls_Manager::SLIDER,
'condition' => $condition,
'selectors' => [
'{{WRAPPER}} .elh-btn--icon-before .elh-btn-icon' => 'margin-right: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .elh-btn--icon-after .elh-btn-icon' => 'margin-left: {{SIZE}}{{UNIT}};',
],
]
);
$this->end_controls_section();
}
/**
* Register styles related controls
*/
protected function register_style_controls() {
$this->start_controls_section(
'_section_style_member_box',
[
'label' => __( 'Box style', 'elementhelper' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->start_controls_tabs(
'_tab_style_member_box_colors'
);
$this->start_controls_tab(
'_tab_style_member_box_normal',
[
'label' => __( 'Normal', 'elementhelper' ),
]
);
$this->add_control(
'member_box_bg_color',
[
'label' => __( 'Background Color', 'elementhelper' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .single-expert-box' => 'background-color: {{VALUE}};',
],
'style_transfer' => true,
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'_tab_style_member_box_hover',
[
'label' => __( 'Hover', 'elementhelper' ),
]
);
$this->add_control(
'hover_member_box_bg_color',
[
'label' => __( 'Background Color', 'elementhelper' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .single-expert-box:hover' => 'background-color: {{VALUE}};','{{WRAPPER}} .single-expert-box:focus' => 'background-color: {{VALUE}};',
],
'style_transfer' => true,
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->end_controls_section();
$this->start_controls_section(
'_section_style_image',
[
'label' => __( 'Profile Image', 'elementhelper' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'image_spacing',
[
'label' => __( 'Bottom Spacing', 'elementhelper' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'selectors' => [
'{{WRAPPER}} .thumb' => 'margin-bottom: {{SIZE}}{{UNIT}} !important;',
],
]
);
$this->add_responsive_control(
'image_padding',
[
'label' => __( 'Padding', 'elementhelper' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [
'{{WRAPPER}} .thumb img' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'image_border',
'selector' => '{{WRAPPER}} .thumb img'
]
);
$this->add_responsive_control(
'image_border_radius',
[
'label' => __( 'Border Radius', 'elementhelper' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'selectors' => [
'{{WRAPPER}} .thumb img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'image_box_shadow',
'exclude' => [
'box_shadow_position',
],
'selector' => '{{WRAPPER}} .elh-member-figure img'
]
);
$this->add_control(
'image_bg_color',
[
'label' => __( 'Background Color', 'elementhelper' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .thumb img' => 'background-color: {{VALUE}};',
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'_section_style_content',
[
'label' => __( 'Name, Job Title & Bio', 'elementhelper' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'content_padding',
[
'label' => __( 'Content Padding', 'elementhelper' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [
'{{WRAPPER}} .expert-box-right' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_control(
'_heading_title',
[
'type' => Controls_Manager::HEADING,
'label' => __( 'Name', 'elementhelper' ),
'separator' => 'before',
]
);
$this->add_responsive_control(
'title_spacing',
[
'label' => __( 'Bottom Spacing', 'elementhelper' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'selectors' => [
'{{WRAPPER}} .single-expert-box .expert-box-left .name' => 'margin-bottom: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_control(
'title_color',
[
'label' => __( 'Text Color', 'elementhelper' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .single-expert-box .expert-box-left .name' => 'color: {{VALUE}}',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'title_typography',
'selector' => '{{WRAPPER}} .single-expert-box .expert-box-left .name',
'scheme' => Typography::TYPOGRAPHY_2,
]
);
$this->add_group_control(
Group_Control_Text_Shadow::get_type(),
[
'name' => 'title_text_shadow',
'selector' => '{{WRAPPER}} .single-expert-box .expert-box-left .name',
]
);
$this->add_control(
'_heading_job_title',
[
'type' => Controls_Manager::HEADING,
'label' => __( 'Job Title', 'elementhelper' ),
'separator' => 'before'
]
);
$this->add_responsive_control(
'job_title_spacing',
[
'label' => __( 'Bottom Spacing', 'elementhelper' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'selectors' => [
'{{WRAPPER}} .designation' => 'margin-bottom: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_control(
'job_title_color',
[
'label' => __( 'Text Color', 'elementhelper' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .designation' => 'color: {{VALUE}}',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'job_title_typography',
'selector' => '{{WRAPPER}} .designation',
'scheme' => Typography::TYPOGRAPHY_3,
]
);
$this->add_group_control(
Group_Control_Text_Shadow::get_type(),
[
'name' => 'job_title_text_shadow',
'selector' => '{{WRAPPER}} .elh-member-position',
]
);
$this->add_control(
'_heading_bio',
[
'type' => Controls_Manager::HEADING,
'label' => __( 'Short Bio', 'elementhelper' ),
'separator' => 'before'
]
);
$this->add_responsive_control(
'bio_spacing',
[
'label' => __( 'Bottom Spacing', 'elementhelper' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'selectors' => [
'{{WRAPPER}} .elh-member-bio' => 'margin-bottom: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_control(
'bio_color',
[
'label' => __( 'Text Color', 'elementhelper' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .elh-member-bio' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'bio_typography',
'selector' => '{{WRAPPER}} .elh-member-bio',
'scheme' => Typography::TYPOGRAPHY_3,
]
);
$this->add_group_control(
Group_Control_Text_Shadow::get_type(),
[
'name' => 'bio_text_shadow',
'selector' => '{{WRAPPER}} .elh-member-bio',
]
);
$this->end_controls_section();
$this->start_controls_section(
'_section_style_social',
[
'label' => __( 'Social Icons', 'elementhelper' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'links_spacing',
[
'label' => __( 'Right Spacing', 'elementhelper' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'selectors' => [
'{{WRAPPER}} .elh-member-links > a:not(:last-child)' => 'margin-right: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'links_padding',
[
'label' => __( 'Padding', 'elementhelper' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'selectors' => [
'{{WRAPPER}} .elh-member-links > a' => 'padding: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'links_icon_size',
[
'label' => __( 'Icon Size', 'elementhelper' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'selectors' => [
'{{WRAPPER}} .elh-member-links > a' => 'font-size: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'links_border',
'selector' => '{{WRAPPER}} .elh-member-links > a'
]
);
$this->add_responsive_control(
'links_border_radius',
[
'label' => __( 'Border Radius', 'elementhelper' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'selectors' => [
'{{WRAPPER}} .elh-member-links > a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->start_controls_tabs( '_tab_links_colors' );
$this->start_controls_tab(
'_tab_links_normal',
[
'label' => __( 'Normal', 'elementhelper' ),
]
);
$this->add_control(
'links_color',
[
'label' => __( 'Text Color', 'elementhelper' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .elh-member-links > a' => 'color: {{VALUE}};',
],
]
);
$this->add_control(
'links_bg_color',
[
'label' => __( 'Background Color', 'elementhelper' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .elh-member-links > a' => 'background-color: {{VALUE}};',
],
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'_tab_links_hover',
[
'label' => __( 'Hover', 'elementhelper' ),
]
);
$this->add_control(
'links_hover_color',
[
'label' => __( 'Text Color', 'elementhelper' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .elh-member-links > a:hover, {{WRAPPER}} .elh-member-links > a:focus' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'links_hover_bg_color',
[
'label' => __( 'Background Color', 'elementhelper' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .elh-member-links > a:hover, {{WRAPPER}} .elh-member-links > a:focus' => 'background-color: {{VALUE}}',
],
]
);
$this->add_control(
'links_hover_border_color',
[
'label' => __( 'Border Color', 'elementhelper' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .elh-member-links > a:hover, {{WRAPPER}} .elh-member-links > a:focus' => 'border-color: {{VALUE}};',
],
'condition' => [
'links_border_border!' => '',
]
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->end_controls_section();
$this->start_controls_section(
'_section_style_button',
[
'label' => __( 'Button', 'elementhelper' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'button_padding',
[
'label' => __( 'Padding', 'elementhelper' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [
'{{WRAPPER}} .site-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'button_typography',
'selector' => '{{WRAPPER}} .elh-btn',
'scheme' => Typography::TYPOGRAPHY_4,
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'button_border',
'selector' => '{{WRAPPER}} .site-btn',
]
);
$this->add_control(
'button_border_radius',
[
'label' => __( 'Border Radius', 'elementhelper' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'selectors' => [
'{{WRAPPER}} .site-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'button_box_shadow',
'selector' => '{{WRAPPER}} .site-btn',
]
);
$this->add_control(
'hr',
[
'type' => Controls_Manager::DIVIDER,
'style' => 'thick',
]
);
$this->start_controls_tabs( '_tabs_button' );
$this->start_controls_tab(
'_tab_button_normal',
[
'label' => __( 'Normal', 'elementhelper' ),
]
);
$this->add_control(
'button_color',
[
'label' => __( 'Text Color', 'elementhelper' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .site-btn' => 'color: {{VALUE}};',
],
]
);
$this->add_control(
'button_bg_color',
[
'label' => __( 'Background Color', 'elementhelper' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .site-btn' => 'background-color: {{VALUE}};',
],
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'_tab_button_hover',
[
'label' => __( 'Hover', 'elementhelper' ),
]
);
$this->add_control(
'button_hover_color',
[
'label' => __( 'Text Color', 'elementhelper' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .site-btn:hover, {{WRAPPER}} .site-btn:focus' => 'color: {{VALUE}};',
],
]
);
$this->add_control(
'button_hover_bg_color',
[
'label' => __( 'Background Color', 'elementhelper' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .site-btn:hover, {{WRAPPER}} .site-btn:focus' => 'background-color: {{VALUE}};',
],
]
);
$this->add_control(
'button_hover_border_color',
[
'label' => __( 'Border Color', 'elementhelper' ),
'type' => Controls_Manager::COLOR,
'condition' => [
'button_border_border!' => '',
],
'selectors' => [
'{{WRAPPER}} .site-btn:hover, {{WRAPPER}} .site-btn:focus' => 'border-color: {{VALUE}};',
],
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
$this->add_inline_editing_attributes( 'title', 'basic' );
$this->add_render_attribute( 'title', 'class', '' );
$this->add_inline_editing_attributes( 'job_title', 'basic' );
$this->add_render_attribute( 'job_title', 'class', '' );
if ( $settings['image']['url'] || $settings['image']['id'] ) :
$this->add_render_attribute( 'image', 'src', $settings['image']['url'] );
$this->add_render_attribute( 'image', 'alt', Control_Media::get_image_alt( $settings['image'] ) );
$this->add_render_attribute( 'image', 'title', Control_Media::get_image_title( $settings['image'] ) );
$settings['hover_animation'] = 'disable-animation'; // hack to prevent image hover animation
endif;
?>
<div class="team-single text-center mb-30">
<div class="team-thumb mb-30">
<?php echo Group_Control_Image_Size::get_attachment_image_html( $settings, 'thumbnail', 'image' ); ?>
</div>
<div class="team-text mb-35">
<h3><a href="<?php echo esc_url($settings['team_url']['url']); ?>"><?php echo esc_html($settings['title']); ?></a></h3>
<?php if ( $settings['job_title' ] ) : ?>
<span <?php $this->print_render_attribute_string( 'job_title' ); ?>><?php echo elh_element_kses_basic( $settings['job_title' ] ); ?></span>
<?php endif; ?>
</div>
<?php if ($settings['show_profiles'] && is_array($settings['profiles'])) : ?>
<div class="team-social">
<?php
foreach ($settings['profiles'] as $profile) :
$icon = !empty($profile['name']) ? $profile['name'] : '';
$url = !empty($profile['link']['url']) ? $profile['link']['url'] : '';
if ($profile['name'] === 'website') {
$icon = 'globe';
} elseif ($profile['name'] === 'email') {
$icon = 'envelope';
$url = 'mailto:' . antispambot($profile['email']);
}
printf('<a target="_blank" rel="noopener" data-tooltip="hello" href="%s" class="elementor-repeater-item-%s comments-btn"><i class="fab fa-%s" aria-hidden="true"></i></a>',
$url,
esc_attr($profile['_id']),
esc_attr($icon)
);
endforeach; ?>
</div>
<?php endif; ?>
</div>
<?php
}
}