register_account_controls();
$this->register_layout_controls();
$this->register_timeline_control();
$this->register_carousel_control();
$this->register_content_tab();
$this->register_helpful_information();
$this->register_spacing_style_tab();
$this->register_timeline_style_control();
$this->register_Carousel_style_tab();
$this->register_content_style_tab();
$this->register_card_style_tab();
$this->register_image_style_tab();
}
/**
* Get twitter api
*
* @since 1.36.0
* @var object $integration_settings
*/
public static $integration_settings;
/**
* Register Twitter Feed Account Controls.
*
* @since 1.36.0
* @access protected
*/
protected function register_account_controls() {
$this->start_controls_section(
'uael_twitter_feed_account',
array(
'label' => __( 'Account', 'uael' ),
)
);
$this->add_control(
'uael_twitter_feed_search_by',
array(
'label' => __( 'Search By', 'uael' ),
'type' => Controls_Manager::SELECT,
'default' => 'username',
'options' => array(
'username' => __( 'Twitter Handle', 'uael' ),
'hashtag' => __( 'Hashtag', 'uael' ),
),
)
);
$this->add_control(
'uael_twitter_feed_username',
array(
'label' => __( 'Twitter Handle', 'uael' ),
'type' => Controls_Manager::TEXT,
'description' => esc_html__( 'Enter your Twitter handle WITHOUT @ sign.', 'uael' ),
'condition' => array(
'uael_twitter_feed_search_by' => 'username',
),
)
);
$this->add_control(
'uael_twitter_feed_hashtag_name',
array(
'label' => __( 'Hashtag', 'uael' ),
'type' => Controls_Manager::TEXT,
'description' => esc_html__( 'Enter your Twitter hashtag WITHOUT # sign.', 'uael' ),
'condition' => array(
'uael_twitter_feed_search_by' => 'hashtag',
),
)
);
if ( ! isset( self::$integration_settings ) ) {
self::$integration_settings = UAEL_Helper::get_integrations_options();
}
if ( empty( self::$integration_settings['uael_twitter_feed_consumer_key'] ) || empty( self::$integration_settings['uael_twitter_feed_consumer_secret'] ) ) {
$widget_list = UAEL_Helper::get_widget_list();
$admin_link = $widget_list['Twitter']['setting_url'];
$this->add_control(
'twitter_err_msg',
array(
'type' => Controls_Manager::RAW_HTML,
/* translators: %s admin link */
'raw' => sprintf( __( 'To display Twitter Feed, you need to configure Twitter Consumer keys. Please configure keys from here.', 'uael' ), $admin_link ),
'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning',
)
);
}
$this->add_control(
'uael_twitter_feed_data_cache_limit',
array(
'label' => __( 'Cache Time (Hours)', 'uael' ),
'type' => Controls_Manager::NUMBER,
'min' => 1,
'max' => 500,
'default' => 1,
'description' => __( 'Feed will be cached for the selected time duration and refreshed after that.', 'uael' ),
)
);
$this->end_controls_section();
}
/**
* Register Twitter Feed General Controls.
*
* @since 1.36.0
* @access protected
*/
protected function register_layout_controls() {
$this->start_controls_section(
'uael_twitter_feed_layout_tab',
array(
'label' => __( 'Layout', 'uael' ),
)
);
$this->add_control(
'uael_twitter_feed_layout',
array(
'label' => esc_html__( 'Content Layout', 'uael' ),
'type' => Controls_Manager::SELECT,
'default' => 'grid',
'options' => array(
'grid' => esc_html__( 'Grid', 'uael' ),
'list' => esc_html__( 'List', 'uael' ),
'timeline' => esc_html__( 'Timeline', 'uael' ),
'carousel' => esc_html__( 'Carousel', 'uael' ),
),
)
);
$this->add_control(
'uael_twitter_feed_sort_by',
array(
'label' => __( 'Sort By', 'uael' ),
'type' => Controls_Manager::SELECT,
'default' => 'recent-posts',
'options' => array(
'recent-posts' => __( 'Newest First', 'uael' ),
'old-posts' => __( 'Oldest First', 'uael' ),
'favorite_count' => __( 'Most Liked', 'uael' ),
'retweet_count' => __( 'Most Retweeted', 'uael' ),
),
)
);
$this->add_responsive_control(
'uael_twitter_feed_col',
array(
'label' => __( 'Columns', 'uael' ),
'type' => Controls_Manager::SELECT,
'tablet_default' => 'col-2',
'mobile_default' => 'col-1',
'options' => array(
'col-1' => '1',
'col-2' => '2',
'col-3' => '3',
'col-4' => '4',
),
'default' => 'col-3',
'frontend_available' => true,
'condition' => array(
'uael_twitter_feed_layout' => array( 'grid' ),
),
)
);
$this->add_control(
'uael_twitter_feed_post_limit',
array(
'label' => esc_html__( 'Post Limit', 'uael' ),
'type' => Controls_Manager::NUMBER,
'label_block' => false,
'default' => 3,
)
);
$this->add_control(
'uael_twitter_feed_show_media',
array(
'label' => esc_html__( 'Show Media ', 'uael' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'yes', 'uael' ),
'label_off' => __( 'no', 'uael' ),
'default' => 'yes',
'return_value' => 'yes',
)
);
$this->add_responsive_control(
'uael_twitter_feed_media_size',
array(
'label' => __( 'Media Size', 'uael' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( '%', 'px', 'em' ),
'range' => array(
'px' => array(
'min' => 1,
'max' => 300,
),
),
'default' => array(
'size' => 100,
'unit' => '%',
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed__title img' => 'width: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .uael-twitter-feed__title video' => 'width: {{SIZE}}{{UNIT}};',
),
'frontend_available' => true,
'condition' => array(
'uael_twitter_feed_show_media' => 'yes',
),
)
);
$this->add_control(
'uael_twitter_feed_content_length',
array(
'label' => esc_html__( 'Content Length', 'uael' ),
'type' => Controls_Manager::NUMBER,
'label_block' => false,
'min' => 1,
'max' => 1000,
'default' => 100,
)
);
$this->add_control(
'uael_twitter_feed_equal_height',
array(
'label' => __( 'Equal Height', 'uael' ),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'yes',
'default' => '',
'label_off' => __( 'No', 'uael' ),
'label_on' => __( 'Yes', 'uael' ),
'prefix_class' => 'uael-equal__height-',
'description' => __( 'Enable this to display all tweets with same height.', 'uael' ),
'condition' => array(
'uael_twitter_feed_layout' => array( 'grid' ),
),
)
);
$this->end_controls_section();
}
/**
* Register Twitter Feed General Controls.
*
* @since 1.36.0
* @access protected
*/
protected function register_content_tab() {
$this->start_controls_section(
'uael_twitter_feed_conent',
array(
'label' => __( 'Content', 'uael' ),
)
);
$this->add_control(
'uael_twitter_feed_profile',
array(
'label' => esc_html__( 'Profile', 'uael' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Show', 'uael' ),
'label_off' => __( 'Hide', 'uael' ),
'default' => 'yes',
'return_value' => 'yes',
)
);
$this->add_control(
'uael_twitter_feed_profile_style',
array(
'label' => __( 'Profile Style', 'uael' ),
'type' => Controls_Manager::SELECT,
'options' => array(
'circle' => 'Circle',
'square' => 'Square',
),
'default' => 'circle',
'condition' => array(
'uael_twitter_feed_profile' => 'yes',
),
)
);
$this->add_control(
'uael_twitter_feed_show_name',
array(
'label' => esc_html__( 'Twitter Name', 'uael' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Show ', 'uael' ),
'label_off' => __( 'Hide', 'uael' ),
'default' => 'yes',
'return_value' => 'yes',
)
);
$this->add_control(
'uael_twitter_feed_show_username',
array(
'label' => esc_html__( 'Twitter Handle', 'uael' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Show ', 'uael' ),
'label_off' => __( 'Hide', 'uael' ),
'default' => 'yes',
'return_value' => 'yes',
)
);
$this->add_control(
'uael_twitter_feed_twitter_logo',
array(
'label' => esc_html__( 'Twitter Logo', 'uael' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Show', 'uael' ),
'label_off' => __( 'Hide', 'uael' ),
'default' => 'yes',
'return_value' => 'yes',
)
);
$this->add_control(
'uael_twitter_feed_read_more',
array(
'label' => esc_html__( 'Read More', 'uael' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Show', 'uael' ),
'label_off' => __( 'Hide', 'uael' ),
'default' => 'yes',
'return_value' => 'yes',
)
);
$this->add_control(
'uael_twitter_feed_read_more_text',
array(
'label' => esc_html__( 'Read More Text', 'uael' ),
'type' => Controls_Manager::TEXT,
'label_block' => false,
'default' => __( 'Read More »', 'uael' ),
'condition' => array(
'uael_twitter_feed_read_more' => 'yes',
),
)
);
$this->add_control(
'uael_twitter_feed_link_target',
array(
'label' => __( 'Link Target', 'uael' ),
'type' => Controls_Manager::SELECT,
'options' => array(
'_self' => __( 'Open in same window', 'uael' ),
'_blank' => __( 'Open in new window', 'uael' ),
),
'default' => '_blank',
'condition' => array(
'uael_twitter_feed_read_more' => 'yes',
),
)
);
$this->add_control(
'uael_twitter_feed_tweet_content',
array(
'label' => esc_html__( 'Feed Content', 'uael' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Show', 'uael' ),
'label_off' => __( 'Hide', 'uael' ),
'default' => 'yes',
'return_value' => 'yes',
)
);
$this->add_control(
'uael_twitter_feed_date',
array(
'label' => esc_html__( 'Date', 'uael' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Show', 'uael' ),
'label_off' => __( 'Hide', 'uael' ),
'default' => 'yes',
'return_value' => 'yes',
)
);
$this->add_control(
'uael_twitter_feed_tweet_info',
array(
'label' => esc_html__( 'Tweet Information', 'uael' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Show', 'uael' ),
'label_off' => __( 'Hide', 'uael' ),
'default' => 'yes',
'return_value' => 'yes',
)
);
$this->end_controls_section();
}
/**
* Register Twitter Feed Card Controls.
*
* @since 1.36.0
* @access protected
*/
protected function register_card_style_tab() {
$this->start_controls_section(
'uael_twitter_feed_card_style',
array(
'label' => esc_html__( 'Card', 'uael' ),
'tab' => Controls_Manager::TAB_STYLE,
)
);
$this->add_responsive_control(
'uael_twitter_feed_card_padding',
array(
'label' => __( 'Padding', 'uael' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', 'em', '%' ),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed .uael-twitter-feed-item .uael-twitter-feed-item-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'default' => array(
'top' => '22',
'right' => '22',
'bottom' => '22',
'left' => '22',
'unit' => 'px',
'isLinked' => true,
),
'frontend_available' => true,
)
);
$this->add_group_control(
\Elementor\Group_Control_Background::get_type(),
array(
'name' => 'uael_twitter_feed_card_gradient_bg',
'label' => __( 'Background', 'uael' ),
'types' => array( 'classic', 'gradient' ),
'selector' => '{{WRAPPER}} .uael-twitter-feed-item-inner',
)
);
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'uael_twitter_feed_card_border',
'label' => __( 'Border', 'uael' ),
'fields_options' => array(
'border' => array(
'default' => 'solid',
),
'width' => array(
'default' => array(
'top' => '1',
'right' => '1',
'bottom' => '1',
'left' => '1',
),
),
'color' => array(
'default' => '#ededed',
),
),
'selector' => '{{WRAPPER}} .uael-twitter-feed .uael-twitter-feed-item .uael-twitter-feed-item-inner',
)
);
$this->add_control(
'uael_twitter_feed_card_border_radius',
array(
'label' => __( 'Border Radius', 'uael' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', 'em', '%' ),
'default' => array(
'top' => '2',
'bottom' => '2',
'right' => '2',
'left' => '2',
'unit' => 'px',
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed .uael-twitter-feed-item .uael-twitter-feed-item-inner' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'(mobile){{WRAPPER}} .uael-twitter-feed .uael-twitter-feed-item .uael-twitter-feed-item-inner' => 'border-radius: 0px;',
),
)
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'uael_twitter_feed_card_shadow',
'selector' => '{{WRAPPER}} .uael-twitter-feed .uael-twitter-feed-item .uael-twitter-feed-item-inner',
)
);
$this->add_control(
'uael_twitter_feed_content_alignment',
array(
'label' => __( 'Content Alignment', 'uael' ),
'type' => Controls_Manager::CHOOSE,
'label_block' => false,
'options' => array(
'left' => array(
'title' => __( 'Left', 'uael' ),
'icon' => 'fa fa-align-left',
),
'center' => array(
'title' => __( 'Center', 'uael' ),
'icon' => 'fa fa-align-center',
),
'right' => array(
'title' => __( 'Right', 'uael' ),
'icon' => 'fa fa-align-right',
),
),
'default' => 'left',
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed-item,{{WRAPPER}}.uael-twitter-feed_inner-content,
{{WRAPPER}}.uael-twitter-feed__title' => 'text-align: {{VALUE}};',
),
)
);
$this->end_controls_section();
}
/**
* Register Twitter Feed Carousel Controls.
*
* @since 1.36.0
* @access protected
*/
protected function register_Carousel_style_tab() {
$this->start_controls_section(
'uael_twitter_feed_carousel',
array(
'label' => __( 'Carousel', 'uael' ),
'tab' => Controls_Manager::TAB_STYLE,
'condition' => array(
'uael_twitter_feed_layout' => 'carousel',
'navigation!' => array( 'none' ),
),
)
);
$this->add_control(
'heading_style_arrows',
array(
'label' => __( 'Arrows', 'uael' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
'condition' => array(
'navigation' => array( 'arrows', 'both' ),
'uael_twitter_feed_layout' => 'carousel',
),
)
);
$this->add_control(
'arrows_position',
array(
'label' => __( 'Arrows Position', 'uael' ),
'type' => Controls_Manager::SELECT,
'default' => 'outside',
'options' => array(
'inside' => __( 'Inside', 'uael' ),
'outside' => __( 'Outside', 'uael' ),
),
'prefix_class' => 'uael-img-carousel-arrow-',
'condition' => array(
'navigation' => array( 'arrows', 'both' ),
'uael_twitter_feed_layout' => 'carousel',
),
)
);
$this->add_control(
'arrows_size',
array(
'label' => __( 'Arrows Size', 'uael' ),
'type' => Controls_Manager::SLIDER,
'range' => array(
'px' => array(
'min' => 20,
'max' => 60,
),
),
'selectors' => array(
'{{WRAPPER}} .slick-slider .slick-prev:before, {{WRAPPER}} .slick-slider .slick-next:before' => 'font-size: {{SIZE}}{{UNIT}};',
),
'condition' => array(
'navigation' => array( 'arrows', 'both' ),
'uael_twitter_feed_layout' => 'carousel',
),
)
);
$this->add_control(
'arrows_color',
array(
'label' => __( 'Arrows Color', 'uael' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .slick-slider .slick-prev:before, {{WRAPPER}} .slick-slider .slick-next:before' => 'color: {{VALUE}};',
),
'condition' => array(
'navigation' => array( 'arrows', 'both' ),
'uael_twitter_feed_layout' => 'carousel',
),
)
);
$this->add_control(
'heading_style_dots',
array(
'label' => __( 'Dots', 'uael' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
'condition' => array(
'navigation' => array( 'dots', 'both' ),
'uael_twitter_feed_layout' => 'carousel',
),
)
);
$this->add_control(
'dots_size',
array(
'label' => __( 'Dots Size', 'uael' ),
'type' => Controls_Manager::SLIDER,
'range' => array(
'px' => array(
'min' => 5,
'max' => 15,
),
),
'selectors' => array(
'{{WRAPPER}} .slick-dots li button:before' => 'font-size: {{SIZE}}{{UNIT}};',
),
'condition' => array(
'navigation' => array( 'dots', 'both' ),
'uael_twitter_feed_layout' => 'carousel',
),
)
);
$this->add_control(
'dots_color',
array(
'label' => __( 'Dots Color', 'uael' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .slick-dots li button:before' => 'color: {{VALUE}};',
),
'condition' => array(
'navigation' => array( 'dots', 'both' ),
'uael_twitter_feed_layout' => 'carousel',
),
)
);
$this->end_controls_section();
}
/**
* Register Twitter Feed Logo Controls.
*
* @since 1.36.0
* @access protected
*/
protected function register_image_style_tab() {
$this->start_controls_section(
'uael_twitter_feed_image',
array(
'label' => __( 'Image', 'uael' ),
'tab' => Controls_Manager::TAB_STYLE,
'conditions' => array(
'relation' => 'or',
'terms' => array(
array(
'name' => 'uael_twitter_feed_profile',
'operator' => '=>',
'value' => 'yes',
),
array(
'name' => 'uael_twitter_feed_twitter_logo',
'operator' => '=>',
'value' => 'yes',
),
),
),
)
);
$this->add_responsive_control(
'uael_twitter_feed_profile_size',
array(
'label' => __( 'Profile Image Size', 'uael' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px', 'em', '%' ),
'range' => array(
'px' => array(
'min' => 1,
'max' => 100,
),
),
'default' => array(
'size' => 46,
'unit' => 'px',
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed-item-avatar img' => 'width: {{SIZE}}{{UNIT}};',
),
'condition' => array(
'uael_twitter_feed_profile' => 'yes',
),
'frontend_available' => true,
)
);
$this->add_control(
'uael_twitter_feed_twitter_logo_size',
array(
'label' => __( 'Twitter Logo', 'uael' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
'condition' => array(
'uael_twitter_feed_twitter_logo' => 'yes',
),
)
);
$this->add_responsive_control(
'uael_twitter_feed_twitter_size',
array(
'label' => __( 'Size', 'uael' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px', 'em', '%' ),
'range' => array(
'px' => array(
'min' => 1,
'max' => 100,
),
),
'default' => array(
'size' => 14,
'unit' => 'px',
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed-twitter-logo .fa-twitter' => 'font-size: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}};',
),
'condition' => array(
'uael_twitter_feed_twitter_logo' => 'yes',
),
'frontend_available' => true,
)
);
$this->add_control(
'uael_twitter_feed_logo_color',
array(
'label' => __( 'Color', 'uael' ),
'type' => Controls_Manager::COLOR,
'default' => '#7f7f7f',
'selectors' => array(
'{{WRAPPER}} i.fab.fa-twitter' => 'color: {{VALUE}};',
),
'condition' => array(
'uael_twitter_feed_twitter_logo' => 'yes',
),
)
);
$this->add_control(
'uael_twitter_feed_logo_hover_color',
array(
'label' => __( 'Hover Color', 'uael' ),
'type' => Controls_Manager::COLOR,
'default' => '#1da1f2',
'selectors' => array(
'{{WRAPPER}} i.fab.fa-twitter:hover' => 'color: {{VALUE}}; opacity:1;',
),
'condition' => array(
'uael_twitter_feed_twitter_logo' => 'yes',
),
)
);
$this->end_controls_section();
}
/**
* Register Twitter Feed Spacing Controls.
*
* @since 1.36.0
* @access protected
*/
protected function register_content_style_tab() {
$this->start_controls_section(
'uael_twitter_feed_content',
array(
'label' => __( 'Content', 'uael' ),
'tab' => Controls_Manager::TAB_STYLE,
)
);
$this->add_control(
'uael_twitter_feed_name',
array(
'label' => __( 'Twitter Name', 'uael' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
'condition' => array(
'uael_twitter_feed_show_name' => 'yes',
),
)
);
$this->add_control(
'uael_twitter_feed_name_color',
array(
'label' => __( 'Color', 'uael' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed .uael-twitter-feed-card-header-icon .uael-twitter-feed-name' => 'color: {{VALUE}};',
),
'condition' => array(
'uael_twitter_feed_show_name' => 'yes',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'uael_twitter_feed_name_typography',
'global' => array(
'default' => Global_Typography::TYPOGRAPHY_ACCENT,
),
'condition' => array(
'uael_twitter_feed_show_name' => 'yes',
),
'selector' => '{{WRAPPER}} .uael-twitter-feed-card-header-icon .uael-twitter-feed-name-username .uael-twitter-feed-name',
)
);
$this->add_control(
'uael_twitter_feed_handler',
array(
'label' => __( 'Twitter Handle', 'uael' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
'condition' => array(
'uael_twitter_feed_show_username' => 'yes',
),
)
);
$this->add_control(
'uael_twitter_feed_handler_color',
array(
'label' => __( 'Color', 'uael' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed .uael-twitter-feed-card-header-icon .uael-twitter-feed-username' => 'color: {{VALUE}};',
),
'condition' => array(
'uael_twitter_feed_show_username' => 'yes',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'uael_twitter_feed_handler_typography',
'global' => array(
'default' => Global_Typography::TYPOGRAPHY_ACCENT,
),
'condition' => array(
'uael_twitter_feed_show_username' => 'yes',
),
'selector' => '{{WRAPPER}} .uael-twitter-feed-card-header-icon .uael-twitter-feed-name-username .uael-twitter-feed-username',
)
);
$this->add_control(
'uael_twitter_feed_content_data',
array(
'label' => __( 'Feed Content', 'uael' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
'condition' => array(
'uael_twitter_feed_tweet_content' => 'yes',
),
)
);
$this->add_control(
'uael_twitter_feed_content_color',
array(
'label' => __( 'Color', 'uael' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed__title p' => 'color: {{VALUE}};',
),
'condition' => array(
'uael_twitter_feed_tweet_content' => 'yes',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'uael_twitter_feed_content_typo',
'global' => array(
'default' => Global_Typography::TYPOGRAPHY_ACCENT,
),
'selector' => '{{WRAPPER}} .uael-twitter-feed__title p',
'condition' => array(
'uael_twitter_feed_tweet_content' => 'yes',
),
)
);
$this->add_control(
'uael_twitter_feed_content_read_more',
array(
'label' => __( 'Read More', 'uael' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
'condition' => array(
'uael_twitter_feed_read_more' => 'yes',
),
)
);
$this->add_control(
'uael_twitter_feed_content_read_more_color',
array(
'label' => __( 'Color', 'uael' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed__title span a' => 'color: {{VALUE}};',
),
'condition' => array(
'uael_twitter_feed_read_more' => 'yes',
),
)
);
$this->add_control(
'uael_twitter_feed_content_hover_color',
array(
'label' => __( 'Hover Color', 'uael' ),
'type' => Controls_Manager::COLOR,
'global' => array(
'default' => Global_Colors::COLOR_ACCENT,
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed__title span a:hover' => 'color: {{VALUE}};',
),
'condition' => array(
'uael_twitter_feed_read_more' => 'yes',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'uael_twitter_feed_content_read_more_typo',
'global' => array(
'default' => Global_Typography::TYPOGRAPHY_ACCENT,
),
'condition' => array(
'uael_twitter_feed_read_more' => 'yes',
),
'selector' => '{{WRAPPER}} .uael-twitter-feed__title span a',
)
);
$this->add_control(
'uael_twitter_feed_content_date_info',
array(
'label' => __( 'Date and Information', 'uael' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
'conditions' => array(
'relation' => 'or',
'terms' => array(
array(
'name' => 'uael_twitter_feed_date',
'operator' => '=>',
'value' => 'yes',
),
array(
'name' => 'uael_twitter_feed_tweet_info',
'operator' => '=>',
'value' => 'yes',
),
),
),
)
);
$this->add_control(
'uael_twitter_feed_content_date_info_color',
array(
'label' => __( 'Color', 'uael' ),
'type' => Controls_Manager::COLOR,
'conditions' => array(
'relation' => 'or',
'terms' => array(
array(
'name' => 'uael_twitter_feed_date',
'operator' => '=>',
'value' => 'yes',
),
array(
'name' => 'uael_twitter_feed_tweet_info',
'operator' => '=>',
'value' => 'yes',
),
),
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed_inner-content' => 'color: {{VALUE}};',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'uael_twitter_feed_content_date_typo',
'global' => array(
'default' => Global_Typography::TYPOGRAPHY_ACCENT,
),
'conditions' => array(
'relation' => 'or',
'terms' => array(
array(
'name' => 'uael_twitter_feed_date',
'operator' => '=>',
'value' => 'yes',
),
array(
'name' => 'uael_twitter_feed_tweet_info',
'operator' => '=>',
'value' => 'yes',
),
),
),
'selector' => '{{WRAPPER}} .uael-twitter-feed_inner-content',
)
);
$this->add_control(
'uael_twitter_feed_content_date_info_count',
array(
'label' => __( 'Count Information', 'uael' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
'condition' => array(
'uael_twitter_feed_tweet_info' => 'yes',
),
)
);
$this->add_control(
'uael_twitter_feed_content_date_info_count_color',
array(
'label' => __( 'Color', 'uael' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed-tweet-info b' => 'color: {{VALUE}};',
),
'condition' => array(
'uael_twitter_feed_tweet_info' => 'yes',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'uael_twitter_feed_content_date_typo_count',
'global' => array(
'default' => Global_Typography::TYPOGRAPHY_ACCENT,
),
'selector' => '{{WRAPPER}} .uael-twitter-feed-tweet-info b',
'condition' => array(
'uael_twitter_feed_tweet_info' => 'yes',
),
)
);
$this->end_controls_section();
}
/**
* Register Twitter Feed Spacing Controls.
*
* @since 1.36.0
* @access protected
*/
protected function register_spacing_style_tab() {
$this->start_controls_section(
'uael_twitter_feed_spacing',
array(
'label' => esc_html__( 'Spacing', 'uael' ),
'tab' => Controls_Manager::TAB_STYLE,
)
);
$this->add_control(
'uael_twitter_feed_spacing_cards',
array(
'label' => __( 'Spacing between cards', 'uael' ),
'type' => Controls_Manager::HEADING,
)
);
$this->add_responsive_control(
'uael_twitter_feed_column_gap',
array(
'label' => __( 'Columns Gap', 'uael' ),
'type' => Controls_Manager::SLIDER,
'default' => array(
'size' => 20,
),
'range' => array(
'px' => array(
'min' => 0,
'max' => 100,
),
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed .uael-twitter-feed-item .uael-twitter-feed-item-inner' => 'margin-right: calc( {{SIZE}}{{UNIT}}/2 ); margin-left: calc( {{SIZE}}{{UNIT}}/2 );',
'{{WRAPPER}} .uael-twitter-feed' => 'margin-left: calc( -{{SIZE}}{{UNIT}}/2 ); margin-right: calc( -{{SIZE}}{{UNIT}}/2 );',
),
'condition' => array(
'uael_twitter_feed_layout' => array( 'grid', 'carousel' ),
),
'frontend_available' => true,
)
);
$this->add_responsive_control(
'uael_twitter_feed_rows_gap',
array(
'label' => __( 'Rows Gap', 'uael' ),
'type' => Controls_Manager::SLIDER,
'default' => array(
'size' => 20,
),
'range' => array(
'px' => array(
'min' => 0,
'max' => 100,
),
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed .uael-twitter-feed-item' => 'margin-bottom: {{SIZE}}{{UNIT}};',
),
'condition' => array(
'uael_twitter_feed_layout!' => array( 'carousel' ),
),
'frontend_available' => true,
)
);
$this->add_control(
'hr',
array(
'type' => \Elementor\Controls_Manager::DIVIDER,
)
);
$this->add_responsive_control(
'uael_twitter_feed_profile_image_margin',
array(
'label' => __( 'Profile Image Spacing', 'uael' ),
'type' => Controls_Manager::SLIDER,
'default' => array(
'size' => 12,
),
'range' => array(
'px' => array(
'min' => 0,
'max' => 50,
),
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed-item-avatar img' => 'margin-right: {{SIZE}}{{UNIT}};',
),
'condition' => array(
'uael_twitter_feed_profile' => 'yes',
),
'frontend_available' => true,
)
);
$this->add_responsive_control(
'uael_twitter_feed_profile_name_handler',
array(
'label' => __( 'Spacing Between Name & Handle', 'uael' ),
'type' => Controls_Manager::SLIDER,
'default' => array(
'size' => 21,
),
'range' => array(
'px' => array(
'min' => 0,
'max' => 50,
),
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed-name-username' => 'line-height: {{SIZE}}{{UNIT}};',
),
'condition' => array(
'uael_twitter_feed_show_name' => 'yes',
'uael_twitter_feed_show_username' => 'yes',
),
'frontend_available' => true,
)
);
$this->add_responsive_control(
'uael_twitter_feed_content_top_margin',
array(
'label' => __( 'Content Top Spacing', 'uael' ),
'type' => Controls_Manager::SLIDER,
'default' => array(
'size' => 10,
),
'range' => array(
'px' => array(
'min' => 0,
'max' => 50,
),
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed__title' => 'margin-top: {{SIZE}}{{UNIT}};',
),
'frontend_available' => true,
)
);
$this->add_responsive_control(
'uael_twitter_feed_media_top_margin',
array(
'label' => __( 'Media Top Spacing', 'uael' ),
'type' => Controls_Manager::SLIDER,
'default' => array(
'size' => 10,
),
'range' => array(
'px' => array(
'min' => 0,
'max' => 50,
),
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed-image-video' => 'margin-top: {{SIZE}}{{UNIT}};',
),
'condition' => array(
'uael_twitter_feed_show_media' => 'yes',
),
'frontend_available' => true,
)
);
$this->add_responsive_control(
'uael_twitter_feed_content_bottom_margin',
array(
'label' => __( 'Content Bottom Spacing', 'uael' ),
'type' => Controls_Manager::SLIDER,
'default' => array(
'size' => 18,
),
'range' => array(
'px' => array(
'min' => 0,
'max' => 50,
),
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed__title' => 'margin-bottom: {{SIZE}}{{UNIT}};',
),
'frontend_available' => true,
)
);
$this->add_responsive_control(
'uael_twitter_feed_date_info',
array(
'label' => __( 'Spacing Between Date & Information', 'uael' ),
'type' => Controls_Manager::SLIDER,
'default' => array(
'size' => 28,
),
'range' => array(
'px' => array(
'min' => 0,
'max' => 50,
),
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed_inner-content' => 'line-height: {{SIZE}}{{UNIT}};',
),
'condition' => array(
'uael_twitter_feed_date' => 'yes',
'uael_twitter_feed_tweet_info' => 'yes',
),
'frontend_available' => true,
)
);
$this->end_controls_section();
}
/**
* Register Twitter Feed Timeline Controls.
*
* @since 1.36.0
* @access protected
*/
protected function register_timeline_style_control() {
$this->start_controls_section(
'uael_twitter_feed_Timeline',
array(
'label' => __( 'Timeline', 'uael' ),
'tab' => Controls_Manager::TAB_STYLE,
'condition' => array(
'uael_twitter_feed_layout' => 'timeline',
'uael_twitter_feed_search_by!' => 'hashtag',
),
)
);
$this->add_control(
'uael_twitter_feed_timeline_label',
array(
'label' => __( 'Timeline', 'uael' ),
'type' => Controls_Manager::HEADING,
)
);
$this->add_control(
'uael_twitter_feed_timeline_background',
array(
'label' => __( 'Background Color', 'uael' ),
'type' => Controls_Manager::COLOR,
'default' => '#fcfcfc',
'selectors' => array(
'{{WRAPPER}} .uael-twitter-profile-feed' => 'background-color: {{VALUE}};',
),
)
);
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'uael_twitter_feed_timeline_border',
'selector' => '{{WRAPPER}} .uael-twitter-profile-feed',
'fields_options' => array(
'border' => array(
'default' => 'solid',
),
'width' => array(
'default' => array(
'top' => '2',
'right' => '2',
'bottom' => '2',
'left' => '2',
),
),
'color' => array(
'default' => '#ededed',
),
),
)
);
$this->add_control(
'uael_twitter_feed_timeline_border_radius',
array(
'label' => __( 'Border Radius', 'uael' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px', '%', 'em' ),
'range' => array(
'%' => array(
'min' => 1,
'max' => 400,
),
),
'default' => array(
'size' => 10,
'unit' => 'px',
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-profile-feed' => 'border-radius: {{SIZE}}{{UNIT}};',
),
)
);
$this->add_control(
'uael_twitter_feed_timeline_profile',
array(
'label' => __( 'Profile', 'uael' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
'condition' => array(
'header_enable' => 'yes',
'header_profile_section' => 'block',
),
)
);
$this->add_responsive_control(
'heading_image_size',
array(
'label' => __( 'Profile Size', 'uael' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px', 'em', '%' ),
'range' => array(
'px' => array(
'min' => 1,
'max' => 400,
),
),
'default' => array(
'size' => 100,
'unit' => 'px',
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed-header-user-image-container .uael-twitter-feed-header-user-image' => 'width: {{SIZE}}{{UNIT}};',
),
'condition' => array(
'header_enable' => 'yes',
'header_profile_section' => 'block',
),
'frontend_available' => true,
)
);
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'uael_twitter_feed_timeline_header_image_border',
'selector' => '{{WRAPPER}} .uael-twitter-feed-header-user-image-container .uael-twitter-feed-header-user-image',
'color' => array(
'default' => '#000',
),
'condition' => array(
'header_enable' => 'yes',
'header_profile_section' => 'block',
),
)
);
$this->add_control(
'uael_twitter_feed_timeline_header_image_border_radius',
array(
'label' => __( 'Border Radius', 'uael' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px', '%', 'em' ),
'range' => array(
'%' => array(
'min' => 1,
'max' => 400,
),
),
'default' => array(
'size' => 50,
'unit' => 'px',
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed-header-user-image-container .uael-twitter-feed-header-user-image' => 'border-radius: {{SIZE}}{{UNIT}};',
),
'condition' => array(
'header_enable' => 'yes',
'header_profile_section' => 'block',
),
)
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'label' => __( 'Shadow', 'uael' ),
'name' => 'uael_twitter_feed_timeline_header_image_shadow',
'selector' => '{{WRAPPER}} .uael-twitter-feed-header-user-image-container .uael-twitter-feed-header-user-image',
'condition' => array(
'header_enable' => 'yes',
'header_profile_section' => 'block',
),
)
);
$this->add_control(
'uael_twitter_feed_timeline_button',
array(
'label' => __( 'Follow Button', 'uael' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
'condition' => array(
'show_button_section' => 'flex',
'header_enable' => 'yes',
),
)
);
$this->add_responsive_control(
'uael_twitter_feed_timeline_button_padding',
array(
'label' => __( 'Padding', 'uael' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', 'em', '%' ),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed-header-user-info-follow' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'default' => array(
'top' => '10',
'right' => '10',
'bottom' => '10',
'left' => '10',
'unit' => 'px',
'isLinked' => true,
),
'condition' => array(
'show_button_section' => 'flex',
'header_enable' => 'yes',
),
)
);
$this->add_control(
'uael_twitter_feed_timeline_button_icon',
array(
'label' => __( 'Icon Position', 'uael' ),
'type' => Controls_Manager::SELECT,
'options' => array(
'row' => __( 'Left', 'uael' ),
'row-reverse' => __( 'Right', 'uael' ),
),
'default' => 'row',
'condition' => array(
'header_enable' => 'yes',
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed-header-user-info-follow' => 'flex-direction: {{VALUE}}',
),
'condition' => array(
'show_button_section' => 'flex',
'header_enable' => 'yes',
),
)
);
$this->end_controls_section();
}
/**
* Register Carousel Controls.
*
* @since 1.36.0
* @access protected
*/
protected function register_carousel_control() {
$this->start_controls_section(
'section_caousel_options',
array(
'label' => __( 'Carousel', 'uael' ),
'type' => Controls_Manager::SECTION,
'condition' => array(
'uael_twitter_feed_layout' => 'carousel',
),
)
);
$this->add_responsive_control(
'slides_to_show',
array(
'label' => __( 'Tweets to Show', 'uael' ),
'type' => Controls_Manager::NUMBER,
'default' => 2,
'tablet_default' => 2,
'mobile_default' => 1,
'condition' => array(
'uael_twitter_feed_layout' => 'carousel',
),
'frontend_available' => true,
)
);
$this->add_responsive_control(
'slides_to_scroll',
array(
'label' => __( 'Tweets to Scroll', 'uael' ),
'type' => Controls_Manager::NUMBER,
'default' => 1,
'tablet_default' => 1,
'mobile_default' => 1,
'condition' => array(
'uael_twitter_feed_layout' => 'carousel',
),
'frontend_available' => true,
)
);
$this->add_control(
'autoplay',
array(
'label' => __( 'Autoplay', 'uael' ),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'yes',
'default' => '',
'condition' => array(
'uael_twitter_feed_layout' => 'carousel',
),
)
);
$this->add_control(
'autoplay_speed',
array(
'label' => __( 'Autoplay Speed (ms)', 'uael' ),
'type' => Controls_Manager::NUMBER,
'default' => 5000,
'condition' => array(
'autoplay' => 'yes',
'uael_twitter_feed_layout' => 'carousel',
),
)
);
$this->add_control(
'pause_on_hover',
array(
'label' => __( 'Pause on Hover', 'uael' ),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'yes',
'default' => 'yes',
'condition' => array(
'autoplay' => 'yes',
'uael_twitter_feed_layout' => 'carousel',
),
)
);
$this->add_control(
'infinite',
array(
'label' => __( 'Infinite Loop', 'uael' ),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'yes',
'default' => 'yes',
'condition' => array(
'uael_twitter_feed_layout' => 'carousel',
),
)
);
$this->add_control(
'transition_speed',
array(
'label' => __( 'Transition Speed (ms)', 'uael' ),
'type' => Controls_Manager::NUMBER,
'default' => 500,
'condition' => array(
'uael_twitter_feed_layout' => 'carousel',
),
)
);
$this->add_control(
'navigation',
array(
'label' => __( 'Navigation', 'uael' ),
'type' => Controls_Manager::SELECT,
'default' => 'both',
'options' => array(
'both' => __( 'Arrows and Dots', 'uael' ),
'arrows' => __( 'Arrows', 'uael' ),
'dots' => __( 'Dots', 'uael' ),
'none' => __( 'None', 'uael' ),
),
'condition' => array(
'uael_twitter_feed_layout' => 'carousel',
),
)
);
$this->end_controls_section();
}
/**
* Register Carousel Controls.
*
* @since 1.36.0
* @access protected
*/
protected function register_timeline_control() {
$this->start_controls_section(
'uael_twitter_feed_timeline',
array(
'label' => __( 'Timeline', 'uael' ),
'type' => Controls_Manager::SECTION,
'condition' => array(
'uael_twitter_feed_layout' => 'timeline',
),
)
);
$this->add_responsive_control(
'uael_twitter_feed_timeline_height',
array(
'label' => __( 'Height', 'uael' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px', '%' ),
'range' => array(
'px' => array(
'min' => 1,
'max' => 1000,
),
),
'default' => array(
'size' => 400,
'unit' => 'px',
),
'condition' => array(
'uael_twitter_feed_layout' => 'timeline',
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-profile-feed .uael-twitter-feed' => 'height: {{SIZE}}{{UNIT}};',
),
'frontend_available' => true,
)
);
$this->add_responsive_control(
'uael_twitter_feed_timeline_width',
array(
'label' => __( 'Width', 'uael' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px', '%' ),
'range' => array(
'px' => array(
'min' => 1,
'max' => 1100,
),
),
'default' => array(
'size' => 100,
'unit' => '%',
),
'condition' => array(
'uael_twitter_feed_layout' => 'timeline',
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-profile-feed' => 'max-width: {{SIZE}}{{UNIT}};',
),
'frontend_available' => true,
)
);
$this->add_control(
'header_enable',
array(
'label' => __( 'Profile Header', 'uael' ),
'type' => Controls_Manager::SWITCHER,
'default' => 'yes',
'label_on' => 'Show',
'label_off' => 'Hide',
'separator' => 'before',
'condition' => array(
'uael_twitter_feed_search_by!' => 'hashtag',
),
)
);
$this->add_control(
'header_profile_section',
array(
'label' => __( 'Profile Image', 'uael' ),
'type' => Controls_Manager::SELECT,
'options' => array(
'block' => __( 'Show', 'uael' ),
'none' => __( 'Hide', 'uael' ),
),
'default' => 'block',
'condition' => array(
'header_enable' => 'yes',
'uael_twitter_feed_search_by!' => 'hashtag',
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed-header-user-image-container img' => 'display: {{VALUE}}',
),
)
);
$this->add_control(
'header_image_section',
array(
'label' => __( 'Cover Image', 'uael' ),
'type' => Controls_Manager::SELECT,
'options' => array(
'block' => __( 'Show', 'uael' ),
'none' => __( 'Hide', 'uael' ),
),
'default' => 'block',
'condition' => array(
'header_enable' => 'yes',
'uael_twitter_feed_search_by!' => 'hashtag',
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-header-banner img' => 'display: {{VALUE}}',
),
)
);
$this->add_responsive_control(
'cover_image_height',
array(
'label' => __( 'Cover Image Height', 'uael' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px', 'em' ),
'range' => array(
'px' => array(
'min' => 0,
'max' => 500,
),
'em' => array(
'min' => 0,
'max' => 30,
),
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-header-banner img' => 'height: {{SIZE}}{{UNIT}}',
),
'condition' => array(
'uael_twitter_feed_search_by!' => 'hashtag',
'header_enable' => 'yes',
'header_image_section' => 'block',
),
'frontend_available' => true,
)
);
$this->add_control(
'author_section',
array(
'label' => __( 'Author Details', 'uael' ),
'type' => Controls_Manager::SELECT,
'options' => array(
'block' => __( 'Show', 'uael' ),
'none' => __( 'Hide', 'uael' ),
),
'default' => 'block',
'condition' => array(
'uael_twitter_feed_search_by!' => 'hashtag',
'header_enable' => 'yes',
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed-header-user-image , {{WRAPPER}} .uael-twitter-feed-header-user-info-name-wrapper' => 'display: {{VALUE}}',
),
)
);
$this->add_control(
'statistics_section',
array(
'label' => __( 'User Data', 'uael' ),
'type' => Controls_Manager::SELECT,
'options' => array(
'flex' => __( 'Show', 'uael' ),
'none' => __( 'Hide', 'uael' ),
),
'default' => 'flex',
'condition' => array(
'uael_twitter_feed_search_by!' => 'hashtag',
'header_enable' => 'yes',
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed-header-statistics' => 'display: {{VALUE}}',
),
)
);
$this->add_control(
'show_button_section',
array(
'label' => __( 'Follow Button', 'uael' ),
'type' => Controls_Manager::SELECT,
'options' => array(
'flex' => __( 'Show', 'uael' ),
'none' => __( 'Hide', 'uael' ),
),
'default' => 'flex',
'condition' => array(
'uael_twitter_feed_search_by!' => 'hashtag',
'header_enable' => 'yes',
),
'selectors' => array(
'{{WRAPPER}} .uael-twitter-feed-header-user-info-follow' => 'display: {{VALUE}}',
),
)
);
$this->end_controls_section();
}
/**
* Helpful Information.
*
* @since 1.36.0
* @access protected
*/
protected function register_helpful_information() {
if ( parent::is_internal_links() ) {
$this->start_controls_section(
'section_helpful_info',
array(
'label' => __( 'Helpful Information', 'uael' ),
)
);
$this->add_control(
'help_doc_1',
array(
'type' => Controls_Manager::RAW_HTML,
/* translators: %1$s doc link */
'raw' => sprintf( __( '%1$s Getting started article » %2$s', 'uael' ), '', '' ),
'content_classes' => 'uael-editor-doc',
)
);
$this->end_controls_section();
}
}
/**
* Number Counter.
*
* @param array $name Twitter field names e.g. followers,following,likes etc count.
* @since 1.36.0
* @access public
*/
public function number_counter( $name ) {
$count_var = $name;
if ( $count_var > 1000000000000 ) {
echo esc_html( round( ( $count_var / 1000000000000 ), 1 ) . 'T ' );
} elseif ( $count_var > 1000000000 ) {
echo esc_html( round( ( $count_var / 1000000000 ), 1 ) . 'B ' );
} elseif ( $count_var > 1000000 ) {
echo esc_html( round( ( $count_var / 1000000 ), 1 ) . 'M ' );
} elseif ( $count_var > 1000 ) {
echo esc_html( round( ( $count_var / 1000 ), 1 ) . 'K ' );
} else {
echo esc_html( round( $count_var ) . ' ' );
}
}
/**
* Carousel attributes.
*
* @since 1.36.0
* @access public
*/
public function get_carousel_attr() {
$settings = $this->get_settings_for_display();
if ( 'carousel' !== $settings['uael_twitter_feed_layout'] ) {
return;
}
$is_rtl = is_rtl();
$direction = $is_rtl ? 'rtl' : 'ltr';
$show_dots = ( in_array( $settings['navigation'], array( 'dots', 'both' ), true ) );
$show_arrows = ( in_array( $settings['navigation'], array( 'arrows', 'both' ), true ) );
$slick_options = array(
'slidesToShow' => ( $settings['slides_to_show'] ) ? absint( $settings['slides_to_show'] ) : 4,
'slidesToScroll' => ( $settings['slides_to_scroll'] ) ? absint( $settings['slides_to_scroll'] ) : 1,
'autoplaySpeed' => ( $settings['autoplay_speed'] ) ? absint( $settings['autoplay_speed'] ) : 5000,
'autoplay' => ( 'yes' === $settings['autoplay'] ),
'infinite' => ( 'yes' === $settings['infinite'] ),
'pauseOnHover' => ( 'yes' === $settings['pause_on_hover'] ),
'speed' => ( $settings['transition_speed'] ) ? absint( $settings['transition_speed'] ) : 500,
'arrows' => $show_arrows,
'dots' => $show_dots,
'rtl' => $is_rtl,
);
if ( $settings['slides_to_show_tablet'] || $settings['slides_to_show_mobile'] ) {
$slick_options['responsive'] = array();
if ( $settings['slides_to_show_tablet'] ) {
$tablet_show = absint( $settings['slides_to_show_tablet'] );
$tablet_scroll = ( $settings['slides_to_scroll_tablet'] ) ? absint( $settings['slides_to_scroll_tablet'] ) : $tablet_show;
$slick_options['responsive'][] = array(
'breakpoint' => 1024,
'settings' => array(
'slidesToShow' => $tablet_show,
'slidesToScroll' => $tablet_scroll,
),
);
}
if ( $settings['slides_to_show_mobile'] ) {
$mobile_show = absint( $settings['slides_to_show_mobile'] );
$mobile_scroll = ( $settings['slides_to_scroll_mobile'] ) ? absint( $settings['slides_to_scroll_mobile'] ) : $mobile_show;
$slick_options['responsive'][] = array(
'breakpoint' => 767,
'settings' => array(
'slidesToShow' => $mobile_show,
'slidesToScroll' => $mobile_scroll,
),
);
}
}
$slick_options = apply_filters( 'uael_twitter_carousel_options', $slick_options );
$this->add_render_attribute(
'carousel-wrap',
array(
'data-twitter_carousel_settings' => wp_json_encode( $slick_options ),
)
);
}
/**
* Twitter Feed Avatar
*
* @param string $item retrive Twitter field.
* @param array $settings retrive all settings.
* @since 1.36.0
*/
public function twitter_feed_header_avatar( $item, $settings ) {
$tweet_profile = ( isset( $item['user']['profile_image_url_https'] ) ) ? $item['user']['profile_image_url_https'] : '';
$tweet_name = ( isset( $item['user']['screen_name'] ) ) ? $item['user']['screen_name'] : '';
$item_logo = str_ireplace( '_normal', '_200x200', $tweet_profile );
$avtar = '';
echo wp_kses_post( $avtar );
}
/**
* Twitter Feed Logo
*
* @since 1.36.0
*/
public function twitter_feed_header_logo() {
?>
' . $read_more . '' ); } $this->twitter_feed_content_media( $item, $settings ); ?>