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