Adv_Accordion.php
1 month ago
Adv_Tabs.php
1 month ago
Advanced_Data_Table.php
3 months ago
Better_Payment.php
4 years ago
Betterdocs_Category_Box.php
2 months ago
Betterdocs_Category_Grid.php
2 months ago
Betterdocs_Search_Form.php
2 months ago
Breadcrumbs.php
1 month ago
Business_Reviews.php
2 months ago
Caldera_Forms.php
1 month ago
Career_Page.php
4 years ago
Code_Snippet.php
3 months ago
Contact_Form_7.php
1 month ago
Content_Ticker.php
3 months ago
Countdown.php
1 month ago
Creative_Button.php
1 month ago
Cta_Box.php
1 month ago
Data_Table.php
1 month ago
Dual_Color_Header.php
1 month ago
EmbedPress.php
4 years ago
Event_Calendar.php
2 months ago
Facebook_Feed.php
3 months ago
Fancy_Text.php
1 month ago
Feature_List.php
3 months ago
Filterable_Gallery.php
1 month ago
Flip_Box.php
1 month ago
FluentForm.php
1 month ago
Formstack.php
1 month ago
GravityForms.php
1 month ago
Image_Accordion.php
1 month ago
Info_Box.php
1 month ago
Interactive_Circle.php
1 month ago
Login_Register.php
3 weeks ago
NFT_Gallery.php
3 months ago
NinjaForms.php
1 month ago
Post_Grid.php
3 months ago
Post_Timeline.php
9 months ago
Pricing_Table.php
1 month ago
Product_Grid.php
3 months ago
Progress_Bar.php
1 month ago
SVG_Draw.php
3 months ago
Simple_Menu.php
2 months ago
Sticky_Video.php
3 months ago
Team_Member.php
3 months ago
Testimonial.php
1 month ago
Tooltip.php
1 month ago
Twitter_Feed.php
3 months ago
TypeForm.php
5 months ago
WeForms.php
1 year ago
Woo_Add_To_Cart.php
1 month ago
Woo_Cart.php
3 months ago
Woo_Checkout.php
3 months ago
Woo_Product_Carousel.php
3 months ago
Woo_Product_Compare.php
1 year ago
Woo_Product_Gallery.php
3 months ago
Woo_Product_Images.php
1 month ago
Woo_Product_List.php
1 month ago
Woo_Product_Price.php
1 month ago
Woo_Product_Rating.php
1 month ago
WpForms.php
1 month ago
index.php
3 years ago
Twitter_Feed.php
1670 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Essential_Addons_Elementor\Elements; |
| 4 | |
| 5 | // If this file is called directly, abort. |
| 6 | if (!defined('ABSPATH')) { |
| 7 | exit; |
| 8 | } |
| 9 | |
| 10 | use \Elementor\Controls_Manager; |
| 11 | use Elementor\Core\Kits\Documents\Tabs\Global_Typography; |
| 12 | use Elementor\Core\Kits\Documents\Tabs\Global_Colors; |
| 13 | use \Elementor\Group_Control_Border; |
| 14 | use \Elementor\Group_Control_Box_Shadow; |
| 15 | use \Elementor\Group_Control_Typography; |
| 16 | use \Elementor\Widget_Base; |
| 17 | use Essential_Addons_Elementor\Classes\Helper; |
| 18 | |
| 19 | class Twitter_Feed extends Widget_Base |
| 20 | { |
| 21 | use \Essential_Addons_Elementor\Traits\Twitter_Feed; |
| 22 | |
| 23 | public function get_name() |
| 24 | { |
| 25 | return 'eael-twitter-feed'; |
| 26 | } |
| 27 | |
| 28 | public function get_title() |
| 29 | { |
| 30 | return esc_html__('X (Twitter) Feed', 'essential-addons-for-elementor-lite'); |
| 31 | } |
| 32 | |
| 33 | public function get_icon() |
| 34 | { |
| 35 | return 'eaicon-twitter-feed'; |
| 36 | } |
| 37 | |
| 38 | public function get_categories() |
| 39 | { |
| 40 | return ['essential-addons-elementor']; |
| 41 | } |
| 42 | |
| 43 | public function get_keywords() |
| 44 | { |
| 45 | return [ |
| 46 | 'twitter', |
| 47 | 'x', |
| 48 | 'ea twitter feed', |
| 49 | 'ea x feed', |
| 50 | 'ea twitter gallery', |
| 51 | 'ea x gallery', |
| 52 | 'social media', |
| 53 | 'twitter embed', |
| 54 | 'x embed', |
| 55 | 'twitter feed', |
| 56 | 'x feed', |
| 57 | 'twitter marketing', |
| 58 | 'x marketing', |
| 59 | 'tweet feed', |
| 60 | 'tweet embed', |
| 61 | 'ea', |
| 62 | 'essential addons', |
| 63 | ]; |
| 64 | } |
| 65 | |
| 66 | public function has_widget_inner_wrapper(): bool { |
| 67 | return ! Helper::eael_e_optimized_markup(); |
| 68 | } |
| 69 | |
| 70 | public function get_custom_help_url() |
| 71 | { |
| 72 | return 'https://essential-addons.com/elementor/docs/twitter-feed/'; |
| 73 | } |
| 74 | |
| 75 | public function get_style_depends() |
| 76 | { |
| 77 | return [ |
| 78 | 'font-awesome-5-all', |
| 79 | 'font-awesome-4-shim', |
| 80 | ]; |
| 81 | } |
| 82 | |
| 83 | public function get_script_depends() |
| 84 | { |
| 85 | return [ |
| 86 | 'font-awesome-4-shim', |
| 87 | ]; |
| 88 | } |
| 89 | |
| 90 | protected function register_controls() |
| 91 | { |
| 92 | $this->start_controls_section( |
| 93 | 'eael_section_twitter_feed_acc_settings', |
| 94 | [ |
| 95 | 'label' => esc_html__('Account Settings', 'essential-addons-for-elementor-lite'), |
| 96 | ] |
| 97 | ); |
| 98 | |
| 99 | $this->add_control( |
| 100 | 'eael_twitter_api_v2', |
| 101 | [ |
| 102 | 'label' => esc_html__( 'Twitter API V2', 'essential-addons-for-elementor-lite' ), |
| 103 | 'type' => Controls_Manager::SWITCHER, |
| 104 | 'label_on' => __( 'Yes', 'essential-addons-for-elementor-lite' ), |
| 105 | 'label_off' => __( 'No', 'essential-addons-for-elementor-lite' ), |
| 106 | 'default' => '', |
| 107 | 'return_value' => 'yes', |
| 108 | ] |
| 109 | ); |
| 110 | |
| 111 | $this->add_control( |
| 112 | 'eael_twitter_feed_ac_name', |
| 113 | [ |
| 114 | 'label' => esc_html__('Account Name', 'essential-addons-for-elementor-lite'), |
| 115 | 'type' => Controls_Manager::TEXT, |
| 116 | 'dynamic' => [ 'active' => true ], |
| 117 | 'default' => '@wpdevteam', |
| 118 | 'label_block' => false, |
| 119 | 'description' => esc_html__('Use @ sign with your account name.', 'essential-addons-for-elementor-lite'), |
| 120 | 'ai' => [ |
| 121 | 'active' => true, |
| 122 | ], |
| 123 | ] |
| 124 | ); |
| 125 | |
| 126 | $this->add_control( |
| 127 | 'eael_twitter_feed_hashtag_name', |
| 128 | [ |
| 129 | 'label' => esc_html__('Hashtag Name', 'essential-addons-for-elementor-lite'), |
| 130 | 'type' => Controls_Manager::TEXT, |
| 131 | 'dynamic' => [ 'active' => true ], |
| 132 | 'label_block' => false, |
| 133 | 'description' => esc_html__('Remove # sign from your hashtag name.', 'essential-addons-for-elementor-lite'), |
| 134 | 'ai' => [ |
| 135 | 'active' => true, |
| 136 | ], |
| 137 | ] |
| 138 | ); |
| 139 | |
| 140 | $this->add_control( |
| 141 | 'eael_twitter_feed_consumer_key', |
| 142 | [ |
| 143 | 'label' => esc_html__('Consumer Key', 'essential-addons-for-elementor-lite'), |
| 144 | 'type' => Controls_Manager::TEXT, |
| 145 | 'label_block' => false, |
| 146 | 'default' => '', |
| 147 | 'description' => '<a href="https://developer.twitter.com/en/portal/dashboard" target="_blank">Get Consumer Key.</a> Create a new app or select existing app and grab the <b>consumer key.</b>', |
| 148 | 'ai' => [ |
| 149 | 'active' => true, |
| 150 | ], |
| 151 | 'condition' => [ |
| 152 | 'eael_twitter_api_v2' => '' |
| 153 | ] |
| 154 | ] |
| 155 | ); |
| 156 | |
| 157 | $this->add_control( |
| 158 | 'eael_twitter_feed_consumer_secret', |
| 159 | [ |
| 160 | 'label' => esc_html__('Consumer Secret', 'essential-addons-for-elementor-lite'), |
| 161 | 'type' => Controls_Manager::TEXT, |
| 162 | 'label_block' => false, |
| 163 | 'default' => '', |
| 164 | 'description' => '<a href="https://developer.twitter.com/en/portal/dashboard" target="_blank">Get Consumer Secret.</a> Create a new app or select existing app and grab the <b>consumer secret.</b>', |
| 165 | 'ai' => [ |
| 166 | 'active' => true, |
| 167 | ], |
| 168 | 'condition' => [ |
| 169 | 'eael_twitter_api_v2' => '' |
| 170 | ] |
| 171 | ] |
| 172 | ); |
| 173 | |
| 174 | $this->add_control( |
| 175 | 'eael_twitter_feed_bearer_token', |
| 176 | [ |
| 177 | 'label' => esc_html__('Bearer Token', 'essential-addons-for-elementor-lite'), |
| 178 | 'type' => Controls_Manager::TEXT, |
| 179 | 'label_block' => false, |
| 180 | 'default' => '', |
| 181 | 'description' => '<a href="https://developer.twitter.com/en/portal/dashboard" target="_blank">Get Bearer Token.</a> Create a new app or select existing app within a project and grab the <b>bearer token.</b>', |
| 182 | 'ai' => [ |
| 183 | 'active' => true, |
| 184 | ], |
| 185 | 'condition' => [ |
| 186 | 'eael_twitter_api_v2' => 'yes' |
| 187 | ] |
| 188 | ] |
| 189 | ); |
| 190 | |
| 191 | $this->add_control( |
| 192 | 'eael_auto_clear_cache', |
| 193 | [ |
| 194 | 'label' => esc_html__( 'Auto Cache Clear', 'essential-addons-for-elementor-lite' ), |
| 195 | 'type' => Controls_Manager::SWITCHER, |
| 196 | 'label_on' => __( 'Yes', 'essential-addons-for-elementor-lite' ), |
| 197 | 'label_off' => __( 'No', 'essential-addons-for-elementor-lite' ), |
| 198 | 'default' => 'yes', |
| 199 | 'return_value' => 'yes', |
| 200 | ] |
| 201 | ); |
| 202 | |
| 203 | $this->add_control( |
| 204 | 'eael_twitter_feed_cache_limit', |
| 205 | [ |
| 206 | 'label' => __( 'Data Cache Time', 'essential-addons-for-elementor-lite' ), |
| 207 | 'type' => Controls_Manager::NUMBER, |
| 208 | 'min' => 1, |
| 209 | 'default' => 60, |
| 210 | 'description' => __( 'Cache expiration time (Minutes)', 'essential-addons-for-elementor-lite' ), |
| 211 | 'condition' => [ |
| 212 | 'eael_auto_clear_cache' => 'yes' |
| 213 | ] |
| 214 | ] |
| 215 | ); |
| 216 | |
| 217 | $this->add_control( |
| 218 | 'eael_clear_cache_control', |
| 219 | [ |
| 220 | 'label' => __( 'Clear Cache', 'essential-addons-for-elementor-lite' ), |
| 221 | 'type' => Controls_Manager::BUTTON, |
| 222 | 'text' => __( 'Clear', 'essential-addons-for-elementor-lite' ), |
| 223 | 'event' => 'ea:cache:clear', |
| 224 | 'description' => esc_html__( 'Note: This will refresh your feed and fetch the latest data from your Twitter account', 'essential-addons-for-elementor-lite' ), |
| 225 | 'condition' => [ |
| 226 | 'eael_auto_clear_cache' => '' |
| 227 | ] |
| 228 | ] |
| 229 | ); |
| 230 | |
| 231 | $this->end_controls_section(); |
| 232 | |
| 233 | $this->start_controls_section( |
| 234 | 'eael_section_twitter_feed_settings', |
| 235 | [ |
| 236 | 'label' => esc_html__('Layout Settings', 'essential-addons-for-elementor-lite'), |
| 237 | ] |
| 238 | ); |
| 239 | |
| 240 | $this->add_control( |
| 241 | 'eael_twitter_feed_type', |
| 242 | [ |
| 243 | 'label' => esc_html__('Content Layout', 'essential-addons-for-elementor-lite'), |
| 244 | 'type' => Controls_Manager::SELECT, |
| 245 | 'default' => 'masonry', |
| 246 | 'options' => [ |
| 247 | 'list' => esc_html__('List', 'essential-addons-for-elementor-lite'), |
| 248 | 'masonry' => esc_html__('Masonry', 'essential-addons-for-elementor-lite'), |
| 249 | ], |
| 250 | ] |
| 251 | ); |
| 252 | |
| 253 | $this->add_control( |
| 254 | 'eael_twitter_feed_type_col_type', |
| 255 | [ |
| 256 | 'label' => __('Column Grid', 'essential-addons-for-elementor-lite'), |
| 257 | 'type' => Controls_Manager::SELECT, |
| 258 | 'options' => [ |
| 259 | 'col-2' => '2 Columns', |
| 260 | 'col-3' => '3 Columns', |
| 261 | 'col-4' => '4 Columns', |
| 262 | ], |
| 263 | 'default' => 'col-3', |
| 264 | 'condition' => [ |
| 265 | 'eael_twitter_feed_type' => 'masonry', |
| 266 | ], |
| 267 | ] |
| 268 | ); |
| 269 | |
| 270 | $this->add_control( |
| 271 | 'eael_twitter_feed_content_length', |
| 272 | [ |
| 273 | 'label' => esc_html__('Content Length', 'essential-addons-for-elementor-lite'), |
| 274 | 'type' => Controls_Manager::NUMBER, |
| 275 | 'label_block' => false, |
| 276 | 'min' => 1, |
| 277 | 'max' => 400, |
| 278 | 'default' => 400, |
| 279 | ] |
| 280 | ); |
| 281 | |
| 282 | $this->add_responsive_control( |
| 283 | 'eael_twitter_feed_column_spacing', |
| 284 | [ |
| 285 | 'label' => esc_html__('Column spacing', 'essential-addons-for-elementor-lite'), |
| 286 | 'type' => Controls_Manager::SLIDER, |
| 287 | 'range' => [ |
| 288 | 'px' => [ |
| 289 | 'max' => 50, |
| 290 | ], |
| 291 | ], |
| 292 | 'default' => [ |
| 293 | 'unit' => 'px', |
| 294 | 'size' => 10, |
| 295 | ], |
| 296 | ] |
| 297 | ); |
| 298 | |
| 299 | $this->add_control( |
| 300 | 'eael_twitter_feed_post_limit', |
| 301 | [ |
| 302 | 'label' => esc_html__('Post Limit', 'essential-addons-for-elementor-lite'), |
| 303 | 'type' => Controls_Manager::NUMBER, |
| 304 | 'label_block' => false, |
| 305 | 'default' => 10, |
| 306 | ] |
| 307 | ); |
| 308 | |
| 309 | $this->add_control( |
| 310 | 'eael_twitter_feed_show_replies', |
| 311 | [ |
| 312 | 'label' => esc_html__('Show Replies', 'essential-addons-for-elementor-lite'), |
| 313 | 'type' => Controls_Manager::SWITCHER, |
| 314 | 'label_on' => __('yes', 'essential-addons-for-elementor-lite'), |
| 315 | 'label_off' => __('no', 'essential-addons-for-elementor-lite'), |
| 316 | 'default' => 'true', |
| 317 | 'return_value' => 'true', |
| 318 | ] |
| 319 | ); |
| 320 | |
| 321 | $this->end_controls_section(); |
| 322 | |
| 323 | $this->start_controls_section( |
| 324 | 'eael_section_twitter_feed_card_settings', |
| 325 | [ |
| 326 | 'label' => esc_html__('Card Settings', 'essential-addons-for-elementor-lite'), |
| 327 | ] |
| 328 | ); |
| 329 | |
| 330 | $this->add_control( |
| 331 | 'eael_twitter_feed_show_avatar', |
| 332 | [ |
| 333 | 'label' => esc_html__('Show Avatar', 'essential-addons-for-elementor-lite'), |
| 334 | 'type' => Controls_Manager::SWITCHER, |
| 335 | 'label_on' => __('yes', 'essential-addons-for-elementor-lite'), |
| 336 | 'label_off' => __('no', 'essential-addons-for-elementor-lite'), |
| 337 | 'default' => 'true', |
| 338 | 'return_value' => 'true', |
| 339 | ] |
| 340 | ); |
| 341 | |
| 342 | $this->add_control( |
| 343 | 'eael_twitter_feed_show_date', |
| 344 | [ |
| 345 | 'label' => esc_html__('Show Date', 'essential-addons-for-elementor-lite'), |
| 346 | 'type' => Controls_Manager::SWITCHER, |
| 347 | 'label_on' => __('yes', 'essential-addons-for-elementor-lite'), |
| 348 | 'label_off' => __('no', 'essential-addons-for-elementor-lite'), |
| 349 | 'default' => 'true', |
| 350 | 'return_value' => 'true', |
| 351 | ] |
| 352 | ); |
| 353 | |
| 354 | $this->add_control( |
| 355 | 'eael_twitter_feed_show_read_more', |
| 356 | [ |
| 357 | 'label' => esc_html__('Show Read More', 'essential-addons-for-elementor-lite'), |
| 358 | 'type' => Controls_Manager::SWITCHER, |
| 359 | 'label_on' => __('yes', 'essential-addons-for-elementor-lite'), |
| 360 | 'label_off' => __('no', 'essential-addons-for-elementor-lite'), |
| 361 | 'default' => 'true', |
| 362 | 'return_value' => 'true', |
| 363 | ] |
| 364 | ); |
| 365 | |
| 366 | $this->add_control( |
| 367 | 'eael_twitter_feed_show_read_more_text', |
| 368 | [ |
| 369 | 'label' => esc_html__('Read More Text', 'essential-addons-for-elementor-lite'), |
| 370 | 'type' => Controls_Manager::TEXT, |
| 371 | 'label_block' => false, |
| 372 | 'default' => __('Read More', 'essential-addons-for-elementor-lite'), |
| 373 | 'condition' => [ |
| 374 | 'eael_twitter_feed_show_read_more' => 'true', |
| 375 | ], |
| 376 | 'ai' => [ |
| 377 | 'active' => true, |
| 378 | ], |
| 379 | ] |
| 380 | ); |
| 381 | |
| 382 | $this->add_control( |
| 383 | 'eael_twitter_feed_show_icon', |
| 384 | [ |
| 385 | 'label' => esc_html__('Show Icon', 'essential-addons-for-elementor-lite'), |
| 386 | 'type' => Controls_Manager::SWITCHER, |
| 387 | 'label_on' => __('yes', 'essential-addons-for-elementor-lite'), |
| 388 | 'label_off' => __('no', 'essential-addons-for-elementor-lite'), |
| 389 | 'default' => 'true', |
| 390 | 'return_value' => 'true', |
| 391 | ] |
| 392 | ); |
| 393 | |
| 394 | $this->add_control( |
| 395 | 'eael_twitter_feed_media', |
| 396 | [ |
| 397 | 'label' => esc_html__('Show Media', 'essential-addons-for-elementor-lite'), |
| 398 | 'type' => Controls_Manager::SWITCHER, |
| 399 | 'label_on' => __('yes', 'essential-addons-for-elementor-lite'), |
| 400 | 'label_off' => __('no', 'essential-addons-for-elementor-lite'), |
| 401 | 'default' => 'true', |
| 402 | 'return_value' => 'true', |
| 403 | ] |
| 404 | ); |
| 405 | |
| 406 | $this->add_control( |
| 407 | 'eael_twitter_feed_hyperlinks_header', |
| 408 | [ |
| 409 | 'label' => esc_html__('Hyperlinks', 'essential-addons-for-elementor-lite'), |
| 410 | 'type' => Controls_Manager::HEADING, |
| 411 | 'separator' => 'before' |
| 412 | ] |
| 413 | ); |
| 414 | |
| 415 | $this->add_control( |
| 416 | 'eael_twitter_feed_hash_linked', |
| 417 | [ |
| 418 | 'label' => esc_html__('Hashtag', 'essential-addons-for-elementor-lite'), |
| 419 | 'type' => Controls_Manager::SWITCHER, |
| 420 | 'label_on' => __('Enable', 'essential-addons-for-elementor-lite'), |
| 421 | 'label_off' => __('Disable', 'essential-addons-for-elementor-lite'), |
| 422 | 'default' => '', |
| 423 | 'return_value' => 'yes', |
| 424 | ] |
| 425 | ); |
| 426 | |
| 427 | $this->add_control( |
| 428 | 'eael_twitter_feed_mention_linked', |
| 429 | [ |
| 430 | 'label' => esc_html__('Mentions', 'essential-addons-for-elementor-lite'), |
| 431 | 'type' => Controls_Manager::SWITCHER, |
| 432 | 'label_on' => __('Enable', 'essential-addons-for-elementor-lite'), |
| 433 | 'label_off' => __('Disable', 'essential-addons-for-elementor-lite'), |
| 434 | 'default' => '', |
| 435 | 'return_value' => 'yes', |
| 436 | ] |
| 437 | ); |
| 438 | |
| 439 | $this->end_controls_section(); |
| 440 | |
| 441 | /** |
| 442 | * Content Tab: Load More Button |
| 443 | */ |
| 444 | $this->start_controls_section( |
| 445 | 'section_pagination', |
| 446 | [ |
| 447 | 'label' => __('Load More Button', 'essential-addons-for-elementor-lite'), |
| 448 | ] |
| 449 | ); |
| 450 | |
| 451 | $this->add_control( |
| 452 | 'pagination', |
| 453 | [ |
| 454 | 'label' => __('Show Load More', 'essential-addons-for-elementor-lite'), |
| 455 | 'type' => Controls_Manager::SWITCHER, |
| 456 | 'default' => 'false', |
| 457 | 'frontend_available' => true, |
| 458 | ] |
| 459 | ); |
| 460 | |
| 461 | $this->add_control( |
| 462 | 'eael_twitter_feed_posts_per_page', |
| 463 | [ |
| 464 | 'label' => __('Posts Per Page', 'essential-addons-for-elementor-lite'), |
| 465 | 'type' => Controls_Manager::TEXT, |
| 466 | 'dynamic' => ['active' => true], |
| 467 | 'default' => 6, |
| 468 | 'condition' => [ |
| 469 | 'pagination' => 'yes', |
| 470 | ], |
| 471 | 'ai' => [ |
| 472 | 'active' => true, |
| 473 | ], |
| 474 | ] |
| 475 | ); |
| 476 | |
| 477 | $this->add_control( |
| 478 | 'load_more_text', |
| 479 | [ |
| 480 | 'label' => __('Button Text', 'essential-addons-for-elementor-lite'), |
| 481 | 'type' => Controls_Manager::TEXT, |
| 482 | 'dynamic' => ['active' => true], |
| 483 | 'default' => __('Load More', 'essential-addons-for-elementor-lite'), |
| 484 | 'condition' => [ |
| 485 | 'pagination' => 'yes', |
| 486 | ], |
| 487 | 'ai' => [ |
| 488 | 'active' => true, |
| 489 | ], |
| 490 | ] |
| 491 | ); |
| 492 | |
| 493 | $this->add_control( |
| 494 | 'nomore_items_text', |
| 495 | [ |
| 496 | 'label' => __('No More Items Text', 'essential-addons-for-elementor-lite'), |
| 497 | 'type' => Controls_Manager::TEXT, |
| 498 | 'dynamic' => ['active' => true], |
| 499 | 'default' => __('No more items!', 'essential-addons-for-elementor-lite'), |
| 500 | 'condition' => [ |
| 501 | 'pagination' => 'yes', |
| 502 | ], |
| 503 | 'ai' => [ |
| 504 | 'active' => true, |
| 505 | ], |
| 506 | ] |
| 507 | ); |
| 508 | |
| 509 | $this->add_control( |
| 510 | 'button_size', |
| 511 | [ |
| 512 | 'label' => __('Size', 'essential-addons-for-elementor-lite'), |
| 513 | 'type' => Controls_Manager::SELECT, |
| 514 | 'default' => 'sm', |
| 515 | 'options' => [ |
| 516 | 'xs' => __('Extra Small', 'essential-addons-for-elementor-lite'), |
| 517 | 'sm' => __('Small', 'essential-addons-for-elementor-lite'), |
| 518 | 'md' => __('Medium', 'essential-addons-for-elementor-lite'), |
| 519 | 'lg' => __('Large', 'essential-addons-for-elementor-lite'), |
| 520 | 'xl' => __('Extra Large', 'essential-addons-for-elementor-lite'), |
| 521 | ], |
| 522 | 'condition' => [ |
| 523 | 'pagination' => 'yes', |
| 524 | 'load_more_text!' => '', |
| 525 | ], |
| 526 | ] |
| 527 | ); |
| 528 | |
| 529 | $this->add_control( |
| 530 | 'load_more_icon_new', |
| 531 | [ |
| 532 | 'label' => __('Button Icon', 'essential-addons-for-elementor-lite'), |
| 533 | 'type' => Controls_Manager::ICONS, |
| 534 | 'fa4compatibility' => 'load_more_icon', |
| 535 | 'condition' => [ |
| 536 | 'pagination' => 'yes', |
| 537 | ], |
| 538 | ] |
| 539 | ); |
| 540 | |
| 541 | $this->add_control( |
| 542 | 'button_icon_position', |
| 543 | [ |
| 544 | 'label' => __('Icon Position', 'essential-addons-for-elementor-lite'), |
| 545 | 'type' => Controls_Manager::SELECT, |
| 546 | 'default' => 'after', |
| 547 | 'options' => [ |
| 548 | 'after' => __('After', 'essential-addons-for-elementor-lite'), |
| 549 | 'before' => __('Before', 'essential-addons-for-elementor-lite'), |
| 550 | ], |
| 551 | 'condition' => [ |
| 552 | 'pagination' => 'yes', |
| 553 | ], |
| 554 | ] |
| 555 | ); |
| 556 | |
| 557 | $this->add_responsive_control( |
| 558 | 'load_more_align', |
| 559 | [ |
| 560 | 'label' => __('Alignment', 'essential-addons-for-elementor-lite'), |
| 561 | 'type' => Controls_Manager::CHOOSE, |
| 562 | 'options' => [ |
| 563 | 'left' => [ |
| 564 | 'title' => __('Left', 'essential-addons-for-elementor-lite'), |
| 565 | 'icon' => 'eicon-h-align-left', |
| 566 | ], |
| 567 | 'center' => [ |
| 568 | 'title' => __('Center', 'essential-addons-for-elementor-lite'), |
| 569 | 'icon' => 'eicon-h-align-center', |
| 570 | ], |
| 571 | 'right' => [ |
| 572 | 'title' => __('Right', 'essential-addons-for-elementor-lite'), |
| 573 | 'icon' => 'eicon-h-align-right', |
| 574 | ], |
| 575 | ], |
| 576 | 'default' => 'center', |
| 577 | 'selectors' => [ |
| 578 | '{{WRAPPER}} .eael-twitter-feed-loadmore-wrap' => 'text-align: {{VALUE}};', |
| 579 | ], |
| 580 | 'condition' => [ |
| 581 | 'pagination' => 'yes', |
| 582 | ], |
| 583 | ] |
| 584 | ); |
| 585 | |
| 586 | $this->end_controls_section(); |
| 587 | |
| 588 | if (!apply_filters('eael/pro_enabled', false)) { |
| 589 | $this->start_controls_section( |
| 590 | 'eael_section_pro', |
| 591 | [ |
| 592 | 'label' => __('Go Premium for More Features', 'essential-addons-for-elementor-lite'), |
| 593 | ] |
| 594 | ); |
| 595 | |
| 596 | $this->add_control( |
| 597 | 'eael_control_get_pro', |
| 598 | [ |
| 599 | 'label' => __('Unlock more possibilities', 'essential-addons-for-elementor-lite'), |
| 600 | 'type' => Controls_Manager::CHOOSE, |
| 601 | 'options' => [ |
| 602 | '1' => [ |
| 603 | 'title' => '', |
| 604 | 'icon' => 'fa fa-unlock-alt', |
| 605 | ], |
| 606 | ], |
| 607 | 'default' => '1', |
| 608 | 'description' => '<span class="pro-feature"> Get the <a href="https://wpdeveloper.com/upgrade/ea-pro" target="_blank">Pro version</a> for more stunning elements and customization options.</span>', |
| 609 | ] |
| 610 | ); |
| 611 | |
| 612 | $this->end_controls_section(); |
| 613 | } |
| 614 | |
| 615 | /** |
| 616 | * ------------------------------------------- |
| 617 | * Tab Style (Twitter Feed Card Style) |
| 618 | * ------------------------------------------- |
| 619 | */ |
| 620 | $this->start_controls_section( |
| 621 | 'eael_section_twitter_feed_card_style_settings', |
| 622 | [ |
| 623 | 'label' => esc_html__('Card Style', 'essential-addons-for-elementor-lite'), |
| 624 | 'tab' => Controls_Manager::TAB_STYLE, |
| 625 | ] |
| 626 | ); |
| 627 | |
| 628 | $this->add_control( |
| 629 | 'eael_twitter_feed_card_choose_style', |
| 630 | [ |
| 631 | 'label' => __('Choose Style', 'essential-addons-for-elementor-lite'), |
| 632 | 'type' => \Elementor\Controls_Manager::SELECT, |
| 633 | 'default' => '', |
| 634 | 'options' => [ |
| 635 | '' => __('Default Style', 'essential-addons-for-elementor-lite'), |
| 636 | 'two' => __('Style Two (right icon)', 'essential-addons-for-elementor-lite'), |
| 637 | 'three' => __('Style Three', 'essential-addons-for-elementor-lite'), |
| 638 | ], |
| 639 | ] |
| 640 | ); |
| 641 | |
| 642 | $this->add_control( |
| 643 | 'eael_twitter_feed_card_left_icon_alignment', |
| 644 | [ |
| 645 | 'label' => __('Left Icon Alignment', 'essential-addons-for-elementor-lite'), |
| 646 | 'type' => \Elementor\Controls_Manager::CHOOSE, |
| 647 | 'options' => [ |
| 648 | 'flex-start' => [ |
| 649 | 'title' => __('Top', 'essential-addons-for-elementor-lite'), |
| 650 | 'icon' => 'eicon-text-align-left', |
| 651 | ], |
| 652 | 'center' => [ |
| 653 | 'title' => __('Middle', 'essential-addons-for-elementor-lite'), |
| 654 | 'icon' => 'eicon-text-align-center', |
| 655 | ], |
| 656 | 'flex-end' => [ |
| 657 | 'title' => __('Bottom', 'essential-addons-for-elementor-lite'), |
| 658 | 'icon' => 'eicon-text-align-right', |
| 659 | ], |
| 660 | ], |
| 661 | 'default' => 'center', |
| 662 | 'selectors' => [ |
| 663 | '{{WRAPPER}} .eael-twitter-feed-entry-iconwrap' => 'align-self: {{VALUE}};', |
| 664 | ], |
| 665 | 'condition' => [ |
| 666 | 'eael_twitter_feed_card_choose_style' => 'three', |
| 667 | ], |
| 668 | ] |
| 669 | ); |
| 670 | |
| 671 | $this->add_control( |
| 672 | 'eael_twitter_feed_card_is_gradient_bg', |
| 673 | [ |
| 674 | 'label' => __('Use gradient Background!', 'essential-addons-for-elementor-lite'), |
| 675 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 676 | 'label_on' => __('Show', 'essential-addons-for-elementor-lite'), |
| 677 | 'label_off' => __('Hide', 'essential-addons-for-elementor-lite'), |
| 678 | 'return_value' => 'yes', |
| 679 | ] |
| 680 | ); |
| 681 | |
| 682 | $this->add_group_control( |
| 683 | \Elementor\Group_Control_Background::get_type(), |
| 684 | [ |
| 685 | 'name' => 'eael_twitter_feed_card_gradient_bg', |
| 686 | 'label' => __('Background', 'essential-addons-for-elementor-lite'), |
| 687 | 'types' => ['classic', 'gradient'], |
| 688 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-item-inner', |
| 689 | 'condition' => [ |
| 690 | 'eael_twitter_feed_card_is_gradient_bg' => 'yes', |
| 691 | ], |
| 692 | ] |
| 693 | ); |
| 694 | |
| 695 | $this->add_control( |
| 696 | 'eael_twitter_feed_card_bg_color', |
| 697 | [ |
| 698 | 'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'), |
| 699 | 'type' => Controls_Manager::COLOR, |
| 700 | 'default' => '', |
| 701 | 'selectors' => [ |
| 702 | '{{WRAPPER}} .eael-twitter-feed-item-inner' => 'background-color: {{VALUE}};', |
| 703 | ], |
| 704 | 'condition' => [ |
| 705 | 'eael_twitter_feed_card_is_gradient_bg' => '', |
| 706 | ], |
| 707 | ] |
| 708 | ); |
| 709 | |
| 710 | $this->add_responsive_control( |
| 711 | 'eael_twitter_feed_card_inner_padding', |
| 712 | [ |
| 713 | 'label' => esc_html__('Main Card Padding', 'essential-addons-for-elementor-lite'), |
| 714 | 'type' => Controls_Manager::DIMENSIONS, |
| 715 | 'size_units' => ['px', 'em', '%'], |
| 716 | 'selectors' => [ |
| 717 | '{{WRAPPER}} .eael-twitter-feed-item-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 718 | ], |
| 719 | 'condition' => [ |
| 720 | 'eael_twitter_feed_card_choose_style' => 'three', |
| 721 | ], |
| 722 | ] |
| 723 | ); |
| 724 | |
| 725 | $this->add_responsive_control( |
| 726 | 'eael_twitter_feed_card_container_padding', |
| 727 | [ |
| 728 | 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'), |
| 729 | 'type' => Controls_Manager::DIMENSIONS, |
| 730 | 'size_units' => ['px', 'em', '%'], |
| 731 | 'selectors' => [ |
| 732 | '{{WRAPPER}} .eael-twitter-feed-item-header' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} 0 {{LEFT}}{{UNIT}};', |
| 733 | '{{WRAPPER}} .eael-twitter-feed-item-content' => 'padding: 0 {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 734 | ], |
| 735 | 'condition' => [ |
| 736 | 'eael_twitter_feed_card_choose_style!' => 'three', |
| 737 | ], |
| 738 | ] |
| 739 | ); |
| 740 | |
| 741 | $this->add_group_control( |
| 742 | Group_Control_Border::get_type(), |
| 743 | [ |
| 744 | 'name' => 'eael_twitter_feed_card_border', |
| 745 | 'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'), |
| 746 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-item-inner', |
| 747 | ] |
| 748 | ); |
| 749 | |
| 750 | $this->add_control( |
| 751 | 'eael_twitter_feed_card_border_radius', |
| 752 | [ |
| 753 | 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'), |
| 754 | 'type' => Controls_Manager::SLIDER, |
| 755 | 'range' => [ |
| 756 | 'px' => [ |
| 757 | 'max' => 500, |
| 758 | ], |
| 759 | ], |
| 760 | 'selectors' => [ |
| 761 | '{{WRAPPER}} .eael-twitter-feed-item-inner' => 'border-radius: {{SIZE}}px;', |
| 762 | ], |
| 763 | ] |
| 764 | ); |
| 765 | |
| 766 | $this->add_group_control( |
| 767 | Group_Control_Box_Shadow::get_type(), |
| 768 | [ |
| 769 | 'name' => 'eael_twitter_feed_card_shadow', |
| 770 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-item-inner', |
| 771 | ] |
| 772 | ); |
| 773 | $this->add_control( |
| 774 | 'eael_twitter_feed_card_left_icon_heading', |
| 775 | [ |
| 776 | 'label' => __('Left Icon Area', 'essential-addons-for-elementor-lite'), |
| 777 | 'type' => \Elementor\Controls_Manager::HEADING, |
| 778 | 'separator' => 'after', |
| 779 | 'condition' => [ |
| 780 | 'eael_twitter_feed_card_choose_style' => 'three', |
| 781 | ], |
| 782 | ] |
| 783 | ); |
| 784 | $this->add_responsive_control( |
| 785 | 'eael_twitter_feed_card_item_left_padding', |
| 786 | [ |
| 787 | 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'), |
| 788 | 'type' => Controls_Manager::DIMENSIONS, |
| 789 | 'size_units' => ['px', 'em', '%'], |
| 790 | 'selectors' => [ |
| 791 | '{{WRAPPER}} .eael-twitter-feed-item-style-three .eael-twitter-feed-item-inner .eael-twitter-feed-entry-iconwrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 792 | ], |
| 793 | 'default' => [ |
| 794 | 'top' => '10', |
| 795 | 'right' => '10', |
| 796 | 'bottom' => '10', |
| 797 | 'left' => '10', |
| 798 | 'unit' => 'px', |
| 799 | 'isLinked' => true, |
| 800 | ], |
| 801 | 'condition' => [ |
| 802 | 'eael_twitter_feed_card_choose_style' => 'three', |
| 803 | ], |
| 804 | ] |
| 805 | ); |
| 806 | $this->add_control( |
| 807 | 'eael_twitter_feed_card_right_content_heading', |
| 808 | [ |
| 809 | 'label' => __('Right Content Area', 'essential-addons-for-elementor-lite'), |
| 810 | 'type' => \Elementor\Controls_Manager::HEADING, |
| 811 | 'separator' => 'after', |
| 812 | 'condition' => [ |
| 813 | 'eael_twitter_feed_card_choose_style' => 'three', |
| 814 | ], |
| 815 | ] |
| 816 | ); |
| 817 | $this->add_responsive_control( |
| 818 | 'eael_twitter_feed_card_item_right_padding', |
| 819 | [ |
| 820 | 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'), |
| 821 | 'type' => Controls_Manager::DIMENSIONS, |
| 822 | 'size_units' => ['px', 'em', '%'], |
| 823 | 'selectors' => [ |
| 824 | '{{WRAPPER}} .eael-twitter-feed-item-style-three .eael-twitter-feed-item-inner .eael-twitter-feed-entry-contentwrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 825 | ], |
| 826 | 'condition' => [ |
| 827 | 'eael_twitter_feed_card_choose_style' => 'three', |
| 828 | ], |
| 829 | ] |
| 830 | ); |
| 831 | $this->add_group_control( |
| 832 | \Elementor\Group_Control_Border::get_type(), |
| 833 | [ |
| 834 | 'name' => 'eael_twitter_feed_card_item_right_border', |
| 835 | 'label' => __('Border', 'essential-addons-for-elementor-lite'), |
| 836 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-item-style-three .eael-twitter-feed-item-inner .eael-twitter-feed-entry-contentwrap', |
| 837 | 'condition' => [ |
| 838 | 'eael_twitter_feed_card_choose_style' => 'three', |
| 839 | ] |
| 840 | ] |
| 841 | ); |
| 842 | |
| 843 | $this->add_control( |
| 844 | 'eael_twitter_feed_card_item_right_border_radius', |
| 845 | [ |
| 846 | 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'), |
| 847 | 'type' => Controls_Manager::DIMENSIONS, |
| 848 | 'size_units' => ['px', 'em', '%'], |
| 849 | 'selectors' => [ |
| 850 | '{{WRAPPER}} .eael-twitter-feed-item-style-three .eael-twitter-feed-item-inner .eael-twitter-feed-entry-contentwrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 851 | ], |
| 852 | 'condition' => [ |
| 853 | 'eael_twitter_feed_card_choose_style' => 'three', |
| 854 | ], |
| 855 | ] |
| 856 | ); |
| 857 | |
| 858 | $this->end_controls_section(); |
| 859 | |
| 860 | /** |
| 861 | * ------------------------------------------- |
| 862 | * Tab Style (Card Hover Style) |
| 863 | * ------------------------------------------- |
| 864 | */ |
| 865 | $this->start_controls_section( |
| 866 | 'eael_section_twitter_feed_card_hover_settings', |
| 867 | [ |
| 868 | 'label' => esc_html__('Card Hover Style', 'essential-addons-for-elementor-lite'), |
| 869 | 'tab' => Controls_Manager::TAB_STYLE, |
| 870 | ] |
| 871 | ); |
| 872 | $this->add_control( |
| 873 | 'eael_twitter_feed_card_hover_title_color', |
| 874 | [ |
| 875 | 'label' => __('Title Color', 'essential-addons-for-elementor-lite'), |
| 876 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 877 | 'selectors' => [ |
| 878 | '{{WRAPPER}} .eael-twitter-feed-item-inner:hover .eael-twitter-feed-item-author' => 'color: {{VALUE}}', |
| 879 | ], |
| 880 | ] |
| 881 | ); |
| 882 | $this->add_control( |
| 883 | 'eael_twitter_feed_card_hover_content_color', |
| 884 | [ |
| 885 | 'label' => __('Content Color', 'essential-addons-for-elementor-lite'), |
| 886 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 887 | 'selectors' => [ |
| 888 | '{{WRAPPER}} .eael-twitter-feed-item-inner:hover .eael-twitter-feed-item-content p' => 'color: {{VALUE}}', |
| 889 | ], |
| 890 | ] |
| 891 | ); |
| 892 | $this->add_control( |
| 893 | 'eael_twitter_feed_card_hover_link_color', |
| 894 | [ |
| 895 | 'label' => __('Link Color', 'essential-addons-for-elementor-lite'), |
| 896 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 897 | 'selectors' => [ |
| 898 | '{{WRAPPER}} .eael-twitter-feed-item-inner:hover .eael-twitter-feed-item-content a' => 'color: {{VALUE}}', |
| 899 | ], |
| 900 | ] |
| 901 | ); |
| 902 | $this->add_control( |
| 903 | 'eael_twitter_feed_card_hover_date_color', |
| 904 | [ |
| 905 | 'label' => __('Date Color', 'essential-addons-for-elementor-lite'), |
| 906 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 907 | 'selectors' => [ |
| 908 | '{{WRAPPER}} .eael-twitter-feed-item-inner:hover .eael-twitter-feed-item-header .eael-twitter-feed-item-date' => 'color: {{VALUE}}', |
| 909 | ], |
| 910 | ] |
| 911 | ); |
| 912 | $this->add_control( |
| 913 | 'eael_twitter_feed_card_hover_icon_color', |
| 914 | [ |
| 915 | 'label' => __('Icon Color', 'essential-addons-for-elementor-lite'), |
| 916 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 917 | 'selectors' => [ |
| 918 | '{{WRAPPER}} .eael-twitter-feed-item-inner:hover .eael-twitter-feed-item-icon' => 'color: {{VALUE}}', |
| 919 | ], |
| 920 | ] |
| 921 | ); |
| 922 | |
| 923 | $this->add_control( |
| 924 | 'eael_twitter_feed_card_border_hover_color', |
| 925 | [ |
| 926 | 'label' => __('Border Color', 'essential-addons-for-elementor-lite'), |
| 927 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 928 | 'selectors' => [ |
| 929 | '{{WRAPPER}} .eael-twitter-feed-item-inner:hover' => 'border-color: {{VALUE}}', |
| 930 | ], |
| 931 | ] |
| 932 | ); |
| 933 | |
| 934 | $this->add_group_control( |
| 935 | \Elementor\Group_Control_Background::get_type(), |
| 936 | [ |
| 937 | 'name' => 'eael_twitter_feed_card_hover_bg', |
| 938 | 'label' => __('Background', 'essential-addons-for-elementor-lite'), |
| 939 | 'types' => ['classic', 'gradient'], |
| 940 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-item-inner:hover', |
| 941 | ] |
| 942 | ); |
| 943 | |
| 944 | $this->add_group_control( |
| 945 | \Elementor\Group_Control_Box_Shadow::get_type(), |
| 946 | [ |
| 947 | 'name' => 'eael_twitter_feed_card_hover_shadow', |
| 948 | 'label' => __('Box Shadow', 'essential-addons-for-elementor-lite'), |
| 949 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-item-inner:hover', |
| 950 | ] |
| 951 | ); |
| 952 | |
| 953 | $this->end_controls_section(); |
| 954 | |
| 955 | /** |
| 956 | * ------------------------------------------- |
| 957 | * Tab Style (Twitter Feed Typography Style) |
| 958 | * ------------------------------------------- |
| 959 | */ |
| 960 | $this->start_controls_section( |
| 961 | 'eael_section_twitter_feed_card_typo_settings', |
| 962 | [ |
| 963 | 'label' => esc_html__('Color & Typography', 'essential-addons-for-elementor-lite'), |
| 964 | 'tab' => Controls_Manager::TAB_STYLE, |
| 965 | ] |
| 966 | ); |
| 967 | |
| 968 | $this->add_control( |
| 969 | 'eael_twitter_feed_title_heading', |
| 970 | [ |
| 971 | 'label' => esc_html__('Title Style', 'essential-addons-for-elementor-lite'), |
| 972 | 'type' => Controls_Manager::HEADING, |
| 973 | ] |
| 974 | ); |
| 975 | |
| 976 | $this->add_control( |
| 977 | 'eael_twitter_feed_title_color', |
| 978 | [ |
| 979 | 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'), |
| 980 | 'type' => Controls_Manager::COLOR, |
| 981 | 'default' => '', |
| 982 | 'selectors' => [ |
| 983 | '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-author' => 'color: {{VALUE}};', |
| 984 | ], |
| 985 | ] |
| 986 | ); |
| 987 | |
| 988 | $this->add_group_control( |
| 989 | Group_Control_Typography::get_type(), |
| 990 | [ |
| 991 | 'name' => 'eael_twitter_feed_title_typography', |
| 992 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-author', |
| 993 | ] |
| 994 | ); |
| 995 | // Content Style |
| 996 | $this->add_control( |
| 997 | 'eael_twitter_feed_content_heading', |
| 998 | [ |
| 999 | 'label' => esc_html__('Content Style', 'essential-addons-for-elementor-lite'), |
| 1000 | 'type' => Controls_Manager::HEADING, |
| 1001 | 'separator' => 'before', |
| 1002 | ] |
| 1003 | ); |
| 1004 | |
| 1005 | $this->add_control( |
| 1006 | 'eael_twitter_feed_content_color', |
| 1007 | [ |
| 1008 | 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'), |
| 1009 | 'type' => Controls_Manager::COLOR, |
| 1010 | 'default' => '', |
| 1011 | 'selectors' => [ |
| 1012 | '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-content p' => 'color: {{VALUE}};', |
| 1013 | ], |
| 1014 | ] |
| 1015 | ); |
| 1016 | |
| 1017 | $this->add_group_control( |
| 1018 | Group_Control_Typography::get_type(), |
| 1019 | [ |
| 1020 | 'name' => 'eael_twitter_feed_content_typography', |
| 1021 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-content p', |
| 1022 | ] |
| 1023 | ); |
| 1024 | |
| 1025 | // Content Link Style |
| 1026 | $this->add_control( |
| 1027 | 'eael_twitter_feed_content_link_heading', |
| 1028 | [ |
| 1029 | 'label' => esc_html__('Link Style', 'essential-addons-for-elementor-lite'), |
| 1030 | 'type' => Controls_Manager::HEADING, |
| 1031 | 'separator' => 'before', |
| 1032 | ] |
| 1033 | ); |
| 1034 | |
| 1035 | $this->add_control( |
| 1036 | 'eael_twitter_feed_content_link_color', |
| 1037 | [ |
| 1038 | 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'), |
| 1039 | 'type' => Controls_Manager::COLOR, |
| 1040 | 'default' => '', |
| 1041 | 'selectors' => [ |
| 1042 | '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-content a' => 'color: {{VALUE}};', |
| 1043 | ], |
| 1044 | ] |
| 1045 | ); |
| 1046 | |
| 1047 | $this->add_control( |
| 1048 | 'eael_twitter_feed_content_link_hover_color', |
| 1049 | [ |
| 1050 | 'label' => esc_html__('Hover Color', 'essential-addons-for-elementor-lite'), |
| 1051 | 'type' => Controls_Manager::COLOR, |
| 1052 | 'default' => '', |
| 1053 | 'selectors' => [ |
| 1054 | '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-content a:hover' => 'color: {{VALUE}};', |
| 1055 | ], |
| 1056 | ] |
| 1057 | ); |
| 1058 | |
| 1059 | $this->add_group_control( |
| 1060 | Group_Control_Typography::get_type(), |
| 1061 | [ |
| 1062 | 'name' => 'eael_twitter_feed_content_link_typography', |
| 1063 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-content a', |
| 1064 | ] |
| 1065 | ); |
| 1066 | |
| 1067 | $this->end_controls_section(); |
| 1068 | |
| 1069 | /** |
| 1070 | * ------------------------------------------- |
| 1071 | * Tab Style (avatar style) |
| 1072 | * ------------------------------------------- |
| 1073 | */ |
| 1074 | $this->start_controls_section( |
| 1075 | 'eael_section_twitter_feed_avatar_style', |
| 1076 | [ |
| 1077 | 'label' => esc_html__('Avatar', 'essential-addons-for-elementor-lite'), |
| 1078 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1079 | 'condition' => [ |
| 1080 | 'eael_twitter_feed_show_avatar' => 'true', |
| 1081 | ], |
| 1082 | ] |
| 1083 | ); |
| 1084 | |
| 1085 | $this->add_control( |
| 1086 | 'eael_twitter_feed_avatar_width', |
| 1087 | [ |
| 1088 | 'label' => __('Width', 'essential-addons-for-elementor-lite'), |
| 1089 | 'type' => Controls_Manager::SLIDER, |
| 1090 | 'size_units' => ['px', '%'], |
| 1091 | 'range' => [ |
| 1092 | 'px' => [ |
| 1093 | 'min' => 0, |
| 1094 | 'max' => 1000, |
| 1095 | 'step' => 5, |
| 1096 | ], |
| 1097 | '%' => [ |
| 1098 | 'min' => 0, |
| 1099 | 'max' => 100, |
| 1100 | ], |
| 1101 | ], |
| 1102 | 'default' => [ |
| 1103 | 'unit' => 'px', |
| 1104 | 'size' => 38, |
| 1105 | ], |
| 1106 | 'selectors' => [ |
| 1107 | '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-avatar img' => 'width: {{SIZE}}{{UNIT}};', |
| 1108 | ], |
| 1109 | ] |
| 1110 | ); |
| 1111 | |
| 1112 | $this->add_control( |
| 1113 | 'eael_twitter_feed_avatar_height', |
| 1114 | [ |
| 1115 | 'label' => __('Height', 'essential-addons-for-elementor-lite'), |
| 1116 | 'type' => Controls_Manager::SLIDER, |
| 1117 | 'size_units' => ['px', '%'], |
| 1118 | 'range' => [ |
| 1119 | 'px' => [ |
| 1120 | 'min' => 0, |
| 1121 | 'max' => 1000, |
| 1122 | 'step' => 5, |
| 1123 | ], |
| 1124 | '%' => [ |
| 1125 | 'min' => 0, |
| 1126 | 'max' => 100, |
| 1127 | ], |
| 1128 | ], |
| 1129 | 'selectors' => [ |
| 1130 | '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-avatar img' => 'height: {{SIZE}}{{UNIT}};', |
| 1131 | ], |
| 1132 | ] |
| 1133 | ); |
| 1134 | |
| 1135 | $this->add_control( |
| 1136 | 'eael_twitter_feed_avatar_style', |
| 1137 | [ |
| 1138 | 'label' => __('Avatar Style', 'essential-addons-for-elementor-lite'), |
| 1139 | 'type' => Controls_Manager::SELECT, |
| 1140 | 'options' => [ |
| 1141 | 'circle' => 'Circle', |
| 1142 | 'square' => 'Square', |
| 1143 | ], |
| 1144 | 'default' => 'circle', |
| 1145 | ] |
| 1146 | ); |
| 1147 | |
| 1148 | $this->add_group_control( |
| 1149 | \Elementor\Group_Control_Border::get_type(), |
| 1150 | [ |
| 1151 | 'name' => 'eael_twitter_feed_avatar_border', |
| 1152 | 'label' => __('Border', 'essential-addons-for-elementor-lite'), |
| 1153 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-avatar img', |
| 1154 | ] |
| 1155 | ); |
| 1156 | $this->add_group_control( |
| 1157 | \Elementor\Group_Control_Box_Shadow::get_type(), |
| 1158 | [ |
| 1159 | 'name' => 'eael_twitter_feed_avatar_shadow', |
| 1160 | 'label' => __('Box Shadow', 'essential-addons-for-elementor-lite'), |
| 1161 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-avatar img', |
| 1162 | ] |
| 1163 | ); |
| 1164 | |
| 1165 | $this->end_controls_section(); |
| 1166 | /** |
| 1167 | * ------------------------------------------- |
| 1168 | * Tab Style (Icon style) |
| 1169 | * ------------------------------------------- |
| 1170 | */ |
| 1171 | $this->start_controls_section( |
| 1172 | 'eael_section_twitter_feed_icon_style', |
| 1173 | [ |
| 1174 | 'label' => esc_html__('Icon', 'essential-addons-for-elementor-lite'), |
| 1175 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1176 | 'condition' => [ |
| 1177 | 'eael_twitter_feed_show_icon' => 'true', |
| 1178 | ], |
| 1179 | ] |
| 1180 | ); |
| 1181 | |
| 1182 | $this->add_control( |
| 1183 | 'eael_section_twitter_feed_icon_size', |
| 1184 | [ |
| 1185 | 'label' => __('Font Size', 'essential-addons-for-elementor-lite'), |
| 1186 | 'type' => Controls_Manager::SLIDER, |
| 1187 | 'size_units' => ['px', '%'], |
| 1188 | 'range' => [ |
| 1189 | 'px' => [ |
| 1190 | 'min' => 0, |
| 1191 | 'max' => 1000, |
| 1192 | 'step' => 5, |
| 1193 | ], |
| 1194 | '%' => [ |
| 1195 | 'min' => 0, |
| 1196 | 'max' => 100, |
| 1197 | ], |
| 1198 | ], |
| 1199 | 'selectors' => [ |
| 1200 | '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-icon' => 'font-size: {{SIZE}}{{UNIT}};', |
| 1201 | ], |
| 1202 | ] |
| 1203 | ); |
| 1204 | |
| 1205 | $this->add_control( |
| 1206 | 'eael_section_twitter_feed_icon_color', |
| 1207 | [ |
| 1208 | 'label' => __('Color', 'essential-addons-for-elementor-lite'), |
| 1209 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 1210 | 'global' => [ |
| 1211 | 'default' => Global_Colors::COLOR_PRIMARY |
| 1212 | ], |
| 1213 | 'selectors' => [ |
| 1214 | '{{WRAPPER}} .eael-twitter-feed-item .eael-twitter-feed-item-icon' => 'color: {{VALUE}}', |
| 1215 | ], |
| 1216 | ] |
| 1217 | ); |
| 1218 | |
| 1219 | $this->end_controls_section(); |
| 1220 | |
| 1221 | /** |
| 1222 | * Style Tab: Load More Button |
| 1223 | * ------------------------------------------------- |
| 1224 | */ |
| 1225 | $this->start_controls_section( |
| 1226 | 'section_loadmore_button_style', |
| 1227 | [ |
| 1228 | 'label' => __('Load More Button', 'essential-addons-for-elementor-lite'), |
| 1229 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1230 | 'condition' => [ |
| 1231 | 'pagination' => 'yes', |
| 1232 | 'load_more_text!' => '', |
| 1233 | ], |
| 1234 | ] |
| 1235 | ); |
| 1236 | |
| 1237 | $this->add_responsive_control( |
| 1238 | 'button_margin_top', |
| 1239 | [ |
| 1240 | 'label' => __('Top Spacing', 'essential-addons-for-elementor-lite'), |
| 1241 | 'type' => Controls_Manager::SLIDER, |
| 1242 | 'range' => [ |
| 1243 | 'px' => [ |
| 1244 | 'min' => 0, |
| 1245 | 'max' => 80, |
| 1246 | 'step' => 1, |
| 1247 | ], |
| 1248 | ], |
| 1249 | 'size_units' => '', |
| 1250 | 'selectors' => [ |
| 1251 | '{{WRAPPER}} .eael-twitter-feed-load-more' => 'margin-top: {{SIZE}}{{UNIT}};', |
| 1252 | ], |
| 1253 | ] |
| 1254 | ); |
| 1255 | |
| 1256 | $this->start_controls_tabs('tabs_eael_load_more_button_style'); |
| 1257 | |
| 1258 | $this->start_controls_tab( |
| 1259 | 'tab_load_more_button_normal', |
| 1260 | [ |
| 1261 | 'label' => __('Normal', 'essential-addons-for-elementor-lite'), |
| 1262 | 'condition' => [ |
| 1263 | 'pagination' => 'yes', |
| 1264 | 'load_more_text!' => '', |
| 1265 | ], |
| 1266 | ] |
| 1267 | ); |
| 1268 | |
| 1269 | $this->add_control( |
| 1270 | 'load_more_button_bg_color_normal', |
| 1271 | [ |
| 1272 | 'label' => __('Background Color', 'essential-addons-for-elementor-lite'), |
| 1273 | 'type' => Controls_Manager::COLOR, |
| 1274 | 'default' => '#333', |
| 1275 | 'selectors' => [ |
| 1276 | '{{WRAPPER}} .eael-twitter-feed-load-more' => 'background-color: {{VALUE}}', |
| 1277 | ], |
| 1278 | 'condition' => [ |
| 1279 | 'pagination' => 'yes', |
| 1280 | 'load_more_text!' => '', |
| 1281 | ], |
| 1282 | ] |
| 1283 | ); |
| 1284 | |
| 1285 | $this->add_control( |
| 1286 | 'load_more_button_text_color_normal', |
| 1287 | [ |
| 1288 | 'label' => __('Text Color', 'essential-addons-for-elementor-lite'), |
| 1289 | 'type' => Controls_Manager::COLOR, |
| 1290 | 'default' => '#fff', |
| 1291 | 'selectors' => [ |
| 1292 | '{{WRAPPER}} .eael-twitter-feed-load-more' => 'color: {{VALUE}}', |
| 1293 | ], |
| 1294 | 'condition' => [ |
| 1295 | 'pagination' => 'yes', |
| 1296 | 'load_more_text!' => '', |
| 1297 | ], |
| 1298 | ] |
| 1299 | ); |
| 1300 | |
| 1301 | $this->add_group_control( |
| 1302 | Group_Control_Border::get_type(), |
| 1303 | [ |
| 1304 | 'name' => 'load_more_button_border_normal', |
| 1305 | 'label' => __('Border', 'essential-addons-for-elementor-lite'), |
| 1306 | 'placeholder' => '1px', |
| 1307 | 'default' => '1px', |
| 1308 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-load-more', |
| 1309 | 'condition' => [ |
| 1310 | 'pagination' => 'yes', |
| 1311 | 'load_more_text!' => '', |
| 1312 | ], |
| 1313 | ] |
| 1314 | ); |
| 1315 | |
| 1316 | $this->add_control( |
| 1317 | 'load_more_button_border_radius', |
| 1318 | [ |
| 1319 | 'label' => __('Border Radius', 'essential-addons-for-elementor-lite'), |
| 1320 | 'type' => Controls_Manager::DIMENSIONS, |
| 1321 | 'size_units' => ['px', '%'], |
| 1322 | 'selectors' => [ |
| 1323 | '{{WRAPPER}} .eael-twitter-feed-load-more' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1324 | ], |
| 1325 | 'condition' => [ |
| 1326 | 'pagination' => 'yes', |
| 1327 | 'load_more_text!' => '', |
| 1328 | ], |
| 1329 | ] |
| 1330 | ); |
| 1331 | |
| 1332 | $this->add_group_control( |
| 1333 | Group_Control_Typography::get_type(), |
| 1334 | [ |
| 1335 | 'name' => 'load_more_button_typography', |
| 1336 | 'label' => __('Typography', 'essential-addons-for-elementor-lite'), |
| 1337 | 'global' => [ |
| 1338 | 'default' => Global_Typography::TYPOGRAPHY_TEXT, |
| 1339 | ], |
| 1340 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-load-more .eael-twitter-feed-load-more-text', |
| 1341 | 'condition' => [ |
| 1342 | 'pagination' => 'yes', |
| 1343 | 'load_more_text!' => '', |
| 1344 | ], |
| 1345 | ] |
| 1346 | ); |
| 1347 | |
| 1348 | $this->add_control( |
| 1349 | 'load_more_button_icon_size', |
| 1350 | [ |
| 1351 | 'label' => __('Icon Size', 'essential-addons-for-elementor-lite'), |
| 1352 | 'type' => Controls_Manager::SLIDER, |
| 1353 | 'default' => [ |
| 1354 | 'size' => 15, |
| 1355 | ], |
| 1356 | 'range' => [ |
| 1357 | 'px' => [ |
| 1358 | 'min' => 20, |
| 1359 | 'max' => 500, |
| 1360 | 'step' => 1, |
| 1361 | ] |
| 1362 | ], |
| 1363 | 'selectors' => [ |
| 1364 | '{{WRAPPER}} .eael-twitter-feed-load-more .eael-twitter-feed-load-more-icon' => 'font-size: {{SIZE}}{{UNIT}};', |
| 1365 | '{{WRAPPER}} .eael-twitter-feed-load-more img.eael-twitter-feed-load-more-icon' => 'height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}};' |
| 1366 | ] |
| 1367 | ] |
| 1368 | ); |
| 1369 | |
| 1370 | $this->add_control( |
| 1371 | 'load_more_button_icon_spacing', |
| 1372 | [ |
| 1373 | 'label' => __('Icon Spacing', 'essential-addons-for-elementor-lite'), |
| 1374 | 'type' => Controls_Manager::SLIDER, |
| 1375 | 'range' => [ |
| 1376 | 'px' => [ |
| 1377 | 'min' => 0, |
| 1378 | 'max' => 50 |
| 1379 | ] |
| 1380 | ], |
| 1381 | 'selectors' => [ |
| 1382 | '{{WRAPPER}} .eael-twitter-feed-load-more .fg-load-more-icon-left' => 'margin-right: {{SIZE}}{{UNIT}};', |
| 1383 | '{{WRAPPER}} .eael-twitter-feed-load-more .fg-load-more-icon-right' => 'margin-left: {{SIZE}}{{UNIT}};', |
| 1384 | ] |
| 1385 | ] |
| 1386 | ); |
| 1387 | |
| 1388 | $this->add_responsive_control( |
| 1389 | 'load_more_button_padding', |
| 1390 | [ |
| 1391 | 'label' => __('Padding', 'essential-addons-for-elementor-lite'), |
| 1392 | 'type' => Controls_Manager::DIMENSIONS, |
| 1393 | 'size_units' => ['px', 'em', '%'], |
| 1394 | 'selectors' => [ |
| 1395 | '{{WRAPPER}} .eael-twitter-feed-load-more' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1396 | ], |
| 1397 | 'condition' => [ |
| 1398 | 'pagination' => 'yes', |
| 1399 | 'load_more_text!' => '', |
| 1400 | ], |
| 1401 | ] |
| 1402 | ); |
| 1403 | |
| 1404 | $this->add_group_control( |
| 1405 | Group_Control_Box_Shadow::get_type(), |
| 1406 | [ |
| 1407 | 'name' => 'load_more_button_box_shadow', |
| 1408 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-load-more', |
| 1409 | 'condition' => [ |
| 1410 | 'pagination' => 'yes', |
| 1411 | 'load_more_text!' => '', |
| 1412 | ], |
| 1413 | ] |
| 1414 | ); |
| 1415 | |
| 1416 | $this->add_control( |
| 1417 | 'load_more_button_icon_heading', |
| 1418 | [ |
| 1419 | 'label' => __('Button Icon', 'essential-addons-for-elementor-lite'), |
| 1420 | 'type' => Controls_Manager::HEADING, |
| 1421 | 'separator' => 'before', |
| 1422 | 'condition' => [ |
| 1423 | 'pagination' => 'yes', |
| 1424 | 'load_more_icon!' => '', |
| 1425 | ], |
| 1426 | ] |
| 1427 | ); |
| 1428 | |
| 1429 | $this->add_responsive_control( |
| 1430 | 'load_more_button_icon_margin', |
| 1431 | [ |
| 1432 | 'label' => __('Margin', 'essential-addons-for-elementor-lite'), |
| 1433 | 'type' => Controls_Manager::DIMENSIONS, |
| 1434 | 'size_units' => ['px', '%'], |
| 1435 | 'placeholder' => [ |
| 1436 | 'top' => '', |
| 1437 | 'right' => '', |
| 1438 | 'bottom' => '', |
| 1439 | 'left' => '', |
| 1440 | ], |
| 1441 | 'selectors' => [ |
| 1442 | '{{WRAPPER}} .eael-twitter-feed-load-more .eael-twitter-feed-load-more-icon' => 'margin-top: {{TOP}}{{UNIT}}; margin-left: {{LEFT}}{{UNIT}}; margin-right: {{RIGHT}}{{UNIT}}; margin-bottom: {{BOTTOM}}{{UNIT}};', |
| 1443 | ], |
| 1444 | 'condition' => [ |
| 1445 | 'pagination' => 'yes', |
| 1446 | 'load_more_icon!' => '', |
| 1447 | ], |
| 1448 | ] |
| 1449 | ); |
| 1450 | |
| 1451 | $this->end_controls_tab(); |
| 1452 | |
| 1453 | $this->start_controls_tab( |
| 1454 | 'tab_button_hover', |
| 1455 | [ |
| 1456 | 'label' => __('Hover', 'essential-addons-for-elementor-lite'), |
| 1457 | 'condition' => [ |
| 1458 | 'pagination' => 'yes', |
| 1459 | 'load_more_text!' => '', |
| 1460 | ], |
| 1461 | ] |
| 1462 | ); |
| 1463 | |
| 1464 | $this->add_control( |
| 1465 | 'button_bg_color_hover', |
| 1466 | [ |
| 1467 | 'label' => __('Background Color', 'essential-addons-for-elementor-lite'), |
| 1468 | 'type' => Controls_Manager::COLOR, |
| 1469 | 'default' => '', |
| 1470 | 'selectors' => [ |
| 1471 | '{{WRAPPER}} .eael-twitter-feed-load-more:hover' => 'background-color: {{VALUE}}', |
| 1472 | ], |
| 1473 | 'condition' => [ |
| 1474 | 'pagination' => 'yes', |
| 1475 | 'load_more_text!' => '', |
| 1476 | ], |
| 1477 | ] |
| 1478 | ); |
| 1479 | |
| 1480 | $this->add_control( |
| 1481 | 'button_text_color_hover', |
| 1482 | [ |
| 1483 | 'label' => __('Text Color', 'essential-addons-for-elementor-lite'), |
| 1484 | 'type' => Controls_Manager::COLOR, |
| 1485 | 'default' => '', |
| 1486 | 'selectors' => [ |
| 1487 | '{{WRAPPER}} .eael-twitter-feed-load-more:hover' => 'color: {{VALUE}}', |
| 1488 | ], |
| 1489 | 'condition' => [ |
| 1490 | 'pagination' => 'yes', |
| 1491 | 'load_more_text!' => '', |
| 1492 | ], |
| 1493 | ] |
| 1494 | ); |
| 1495 | |
| 1496 | $this->add_control( |
| 1497 | 'button_border_color_hover', |
| 1498 | [ |
| 1499 | 'label' => __('Border Color', 'essential-addons-for-elementor-lite'), |
| 1500 | 'type' => Controls_Manager::COLOR, |
| 1501 | 'default' => '', |
| 1502 | 'selectors' => [ |
| 1503 | '{{WRAPPER}} .eael-twitter-feed-load-more:hover' => 'border-color: {{VALUE}}', |
| 1504 | ], |
| 1505 | 'condition' => [ |
| 1506 | 'pagination' => 'yes', |
| 1507 | 'load_more_text!' => '', |
| 1508 | ], |
| 1509 | ] |
| 1510 | ); |
| 1511 | |
| 1512 | $this->add_group_control( |
| 1513 | Group_Control_Box_Shadow::get_type(), |
| 1514 | [ |
| 1515 | 'name' => 'button_box_shadow_hover', |
| 1516 | 'selector' => '{{WRAPPER}} .eael-twitter-feed-load-more:hover', |
| 1517 | 'condition' => [ |
| 1518 | 'pagination' => 'yes', |
| 1519 | 'load_more_text!' => '', |
| 1520 | ], |
| 1521 | ] |
| 1522 | ); |
| 1523 | |
| 1524 | $this->end_controls_tab(); |
| 1525 | $this->end_controls_tabs(); |
| 1526 | |
| 1527 | $this->end_controls_section(); |
| 1528 | } |
| 1529 | |
| 1530 | protected function render_loadmore_button() |
| 1531 | { |
| 1532 | $settings = $this->get_settings_for_display(); |
| 1533 | $icon_migrated = isset($settings['__fa4_migrated']['load_more_icon_new']); |
| 1534 | $icon_is_new = empty($settings['load_more_icon']); |
| 1535 | |
| 1536 | $post_per_page = ! empty($settings['eael_twitter_feed_posts_per_page']) ? $settings['eael_twitter_feed_posts_per_page'] : 10; |
| 1537 | $post_limit = ! empty( $settings['eael_twitter_feed_post_limit'] ) ? $settings['eael_twitter_feed_post_limit'] : 10; |
| 1538 | $load_more_class = $post_per_page < $post_limit ? 'eael-d-block' : 'eael-d-none'; |
| 1539 | |
| 1540 | $this->add_render_attribute('load-more-button', 'class', [ |
| 1541 | 'eael-twitter-feed-load-more', |
| 1542 | 'elementor-button', |
| 1543 | 'elementor-size-' . $settings['button_size'], |
| 1544 | ]); |
| 1545 | |
| 1546 | if ($settings['pagination'] == 'yes' && self::$twitter_feed_fetched_count > $post_per_page ) { ?> |
| 1547 | <div class="eael-twitter-feed-loadmore-wrap"> |
| 1548 | <a href="#" <?php $this->print_render_attribute_string('load-more-button'); ?>> |
| 1549 | <span class="eael-btn-loader"></span> |
| 1550 | <?php if ($settings['button_icon_position'] == 'before') { ?> |
| 1551 | <?php if ($icon_is_new || $icon_migrated) { ?> |
| 1552 | <?php if (isset($settings['load_more_icon_new']['value']['url'])) : ?> |
| 1553 | <img class="eael-twitter-feed-load-more-icon fg-load-more-icon-left" src="<?php echo esc_url($settings['load_more_icon_new']['value']['url']); ?>" alt="<?php echo esc_attr(get_post_meta($settings['load_more_icon_new']['value']['id'], '_wp_attachment_image_alt', true)); ?>" /> |
| 1554 | <?php else : ?> |
| 1555 | <span class="eael-twitter-feed-load-more-icon fg-load-more-icon-left <?php echo esc_attr($settings['load_more_icon_new']['value']); ?>" aria-hidden="true"></span> |
| 1556 | <?php endif; ?> |
| 1557 | <?php } else { ?> |
| 1558 | <span class="eael-twitter-feed-load-more-icon fg-load-more-icon-left <?php echo esc_attr($settings['load_more_icon']); ?>" aria-hidden="true"></span> |
| 1559 | <?php } ?> |
| 1560 | <?php } ?> |
| 1561 | <span class="eael-twitter-feed-load-more-text"> |
| 1562 | <?php echo wp_kses( $settings['load_more_text'], Helper::eael_allowed_tags() ); ?> |
| 1563 | </span> |
| 1564 | <?php if ($settings['button_icon_position'] == 'after') { ?> |
| 1565 | <?php if ($icon_is_new || $icon_migrated) { ?> |
| 1566 | <?php if (isset($settings['load_more_icon_new']['value']['url'])) : ?> |
| 1567 | <img class="eael-twitter-feed-load-more-icon fg-load-more-icon-right" src="<?php echo esc_url($settings['load_more_icon_new']['value']['url']); ?>" alt="<?php echo esc_attr(get_post_meta($settings['load_more_icon_new']['value']['id'], '_wp_attachment_image_alt', true)); ?>" /> |
| 1568 | <?php else : ?> |
| 1569 | <span class="eael-twitter-feed-load-more-icon fg-load-more-icon-right <?php echo esc_attr($settings['load_more_icon_new']['value']); ?>" aria-hidden="true"></span> |
| 1570 | <?php endif; ?> |
| 1571 | <?php } else { ?> |
| 1572 | <span class="eael-twitter-feed-load-more-icon fg-load-more-icon-right <?php echo esc_attr($settings['load_more_icon']); ?>" aria-hidden="true"></span> |
| 1573 | <?php } ?> |
| 1574 | <?php } ?> |
| 1575 | </a> |
| 1576 | </div> |
| 1577 | <?php } |
| 1578 | } |
| 1579 | |
| 1580 | protected function render() |
| 1581 | { |
| 1582 | $settings = $this->get_settings_for_display(); |
| 1583 | $feedcolumnspacing = $this->get_settings('eael_twitter_feed_column_spacing')['size']; |
| 1584 | |
| 1585 | $no_more_items_text = Helper::eael_wp_kses($settings['nomore_items_text']); |
| 1586 | $post_limit = ! empty( $settings['eael_twitter_feed_post_limit'] ) ? intval( $settings['eael_twitter_feed_post_limit'] ) : 10; |
| 1587 | |
| 1588 | $this->add_render_attribute('twitter-feed-wrap', [ |
| 1589 | 'class' => [ |
| 1590 | 'eael-twitter-feed', |
| 1591 | 'eael-twitter-feed-' . $this->get_id(), |
| 1592 | 'eael-twitter-feed-' . $settings['eael_twitter_feed_type'], |
| 1593 | 'eael-twitter-feed-' . $settings['eael_twitter_feed_type_col_type'], |
| 1594 | 'clearfix', |
| 1595 | ], |
| 1596 | 'data-gutter' => $settings['eael_twitter_feed_column_spacing']['size'], |
| 1597 | 'data-posts-per-page' => $settings['eael_twitter_feed_posts_per_page'], |
| 1598 | 'data-total-posts' => $post_limit, |
| 1599 | 'data-nomore-item-text' => $no_more_items_text, |
| 1600 | 'data-next-page' => 2, |
| 1601 | ]); |
| 1602 | |
| 1603 | ?> |
| 1604 | <div> |
| 1605 | <div <?php $this->print_render_attribute_string('twitter-feed-wrap') ?> > |
| 1606 | <?php |
| 1607 | // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 1608 | echo $this->twitter_feed_render_items($this->get_id(), $settings) ?> |
| 1609 | </div> |
| 1610 | <div class="clearfix"> |
| 1611 | <?php |
| 1612 | // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 1613 | echo $this->render_loadmore_button() ?> |
| 1614 | </div> |
| 1615 | </div> |
| 1616 | |
| 1617 | <?php |
| 1618 | echo '<style> |
| 1619 | .eael-twitter-feed-' . esc_html( $this->get_id() ) . '.eael-twitter-feed-masonry.eael-twitter-feed-col-2 .eael-twitter-feed-item { |
| 1620 | width: calc(50% - ' . esc_html( ceil($feedcolumnspacing / 2) ) . 'px); |
| 1621 | } |
| 1622 | .eael-twitter-feed-' . esc_html( $this->get_id() ) . '.eael-twitter-feed-masonry.eael-twitter-feed-col-3 .eael-twitter-feed-item { |
| 1623 | width: calc(33.33% - ' . esc_html( ceil($settings['eael_twitter_feed_column_spacing']['size'] * 2 / 3) ) . 'px); |
| 1624 | } |
| 1625 | .eael-twitter-feed-' . esc_html( $this->get_id() ) . '.eael-twitter-feed-masonry.eael-twitter-feed-col-4 .eael-twitter-feed-item { |
| 1626 | width: calc(25% - ' . esc_html( ceil($feedcolumnspacing * 3 / 4) ) . 'px); |
| 1627 | } |
| 1628 | |
| 1629 | .eael-twitter-feed-' . esc_html( $this->get_id() ) . '.eael-twitter-feed-col-2 .eael-twitter-feed-item, |
| 1630 | .eael-twitter-feed-' . esc_html( $this->get_id() ) . '.eael-twitter-feed-col-3 .eael-twitter-feed-item, |
| 1631 | .eael-twitter-feed-' . esc_html( $this->get_id() ) . '.eael-twitter-feed-col-4 .eael-twitter-feed-item { |
| 1632 | margin-bottom: ' . esc_html( $settings['eael_twitter_feed_column_spacing']['size'] ) . 'px; |
| 1633 | } |
| 1634 | @media only screen and (min-width: 768px) and (max-width: 992px) { |
| 1635 | .eael-twitter-feed-' . esc_html( $this->get_id() ) . '.eael-twitter-feed-masonry.eael-twitter-feed-col-3 .eael-twitter-feed-item, |
| 1636 | .eael-twitter-feed-' . esc_html( $this->get_id() ) . '.eael-twitter-feed-masonry.eael-twitter-feed-col-4 .eael-twitter-feed-item { |
| 1637 | width: calc(50% - ' . esc_html( ceil($feedcolumnspacing / 2) ) . 'px); |
| 1638 | } |
| 1639 | } |
| 1640 | </style>'; |
| 1641 | if (\Elementor\Plugin::instance()->editor->is_edit_mode()) { |
| 1642 | echo '<script type="text/javascript"> |
| 1643 | jQuery(document).ready(function($) { |
| 1644 | $(".eael-twitter-feed").each(function() { |
| 1645 | var $node_id = "' . esc_js( $this->get_id() ) . '", |
| 1646 | $scope = $(".elementor-element-"+$node_id+""), |
| 1647 | $gutter = $(".eael-twitter-feed", $scope).data("gutter"), |
| 1648 | $settings = { |
| 1649 | itemSelector: ".eael-twitter-feed-item", |
| 1650 | percentPosition: true, |
| 1651 | masonry: { |
| 1652 | columnWidth: ".eael-twitter-feed-item", |
| 1653 | gutter: $gutter |
| 1654 | } |
| 1655 | }; |
| 1656 | |
| 1657 | // init isotope |
| 1658 | $twitter_feed_gallery = $(".eael-twitter-feed", $scope).isotope($settings); |
| 1659 | |
| 1660 | // layout gal, while images are loading |
| 1661 | $twitter_feed_gallery.imagesLoaded().progress(function() { |
| 1662 | $twitter_feed_gallery.isotope("layout"); |
| 1663 | }); |
| 1664 | }); |
| 1665 | }); |
| 1666 | </script>'; |
| 1667 | } |
| 1668 | } |
| 1669 | } |
| 1670 |