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