Current File : /home/kelaby89/babyl0n.restaurant/wp-content/plugins/restar-core/addons/widgets/restar-social.php |
<?php
use \Elementor\Widget_Base;
use \Elementor\Controls_Manager;
use \Elementor\Group_Control_Typography;
use \Elementor\Utils;
use \Elementor\Group_Control_Image_Size;
use \Elementor\Group_Control_Box_Shadow;
use \Elementor\Group_Control_Border;
use \Elementor\Repeater;
/**
*
* Social Widget .
*
*/
class Restar_Social extends Widget_Base {
public function get_name() {
return 'restarsocial';
}
public function get_title() {
return __( 'Social', 'restar' );
}
public function get_icon() {
return 'th-icon';
}
public function get_categories() {
return [ 'restar' ];
}
protected function register_controls() {
$this->start_controls_section(
'social_section',
[
'label' => __( 'Social', 'restar' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
restar_select_field( $this, 'layout_style', 'Layout Style',['Style One'] );
restar_general_fields( $this, 'title', 'Title', 'TEXTAREA2', 'Follow Us:', ['1'] );
//Social List
restar_social_fields($this, 'social_icon_list', 'Social List');
$this->end_controls_section();
//---------------------------------------
//Style Section Start
//---------------------------------------
restar_common_style_fields( $this, 'title', 'Title', '{{WRAPPER}} .social-title' );
}
protected function render() {
$settings = $this->get_settings_for_display();
if( $settings['layout_style'] == '1' ){
echo '<div class="th-social">';
if(!empty($settings['title'])){
echo '<span class="social-title">'.wp_kses_post($settings['title']).'</span>';
}
foreach( $settings['social_icon_list'] as $social_icon ){
$social_target = $social_icon['icon_link']['is_external'] ? ' target="_blank"' : '';
$social_nofollow = $social_icon['icon_link']['nofollow'] ? ' rel="nofollow"' : '';
echo '<a '.wp_kses_post( $social_target.$social_nofollow ).' href="'.esc_url( $social_icon['icon_link']['url'] ).'">';
\Elementor\Icons_Manager::render_icon( $social_icon['social_icon'], [ 'aria-hidden' => 'true' ] );
echo '</a> ';
}
echo '</div>';
}
}
}