PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.5.8
Shortcodes and extra features for Phlox theme v2.5.8
2.17.21 2.17.20 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.6 1.0.9 1.1.0 1.3.0 1.3.1 1.3.10 1.3.14 1.3.2 1.3.3 1.3.6 1.4.0 1.4.1 1.4.2 1.5.0 1.5.2 1.6.0 1.6.2 1.6.4 1.7.0 1.7.2 2.10.0 2.10.1 2.10.3 2.10.5 2.10.7 2.10.8 2.10.9 2.11.0 2.11.1 2.11.2 2.12.0 2.14.0 2.15.0 2.15.2 2.15.4 2.15.5 2.15.6 2.15.7 2.15.8 2.15.9 2.16.0 2.16.1 2.16.2 2.16.3 2.16.4 2.17.0 2.17.1 2.17.12 2.17.13 2.17.14 2.17.15 2.17.16 2.17.2 2.17.3 2.17.4 2.17.5 2.17.6 2.17.8 2.17.9 2.4.12 2.4.13 2.4.14 2.4.16 2.4.18 2.4.19 2.4.9 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.15 2.5.16 2.5.17 2.5.19 2.5.2 2.5.20 2.5.3 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.10 2.6.12 2.6.13 2.6.14 2.6.15 2.6.16 2.6.17 2.6.19 2.6.2 2.6.20 2.6.4 2.6.5 2.6.7 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.9 2.9.0 2.9.12 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.19 2.9.2 2.9.20 2.9.21 2.9.22 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8
auxin-elements / includes / elementor / widgets / recent-posts-tiles.php
auxin-elements / includes / elementor / widgets Last commit date
theme-elements 6 years ago accordion.php 6 years ago audio.php 6 years ago before-after.php 6 years ago button.php 6 years ago carousel-navigation.php 6 years ago contact-box.php 6 years ago contact-form.php 6 years ago custom-list.php 6 years ago divider.php 6 years ago gallery.php 6 years ago gmap.php 6 years ago heading-modern.php 6 years ago icon.php 6 years ago image.php 6 years ago mailchimp.php 6 years ago modern-button.php 6 years ago quote.php 6 years ago recent-comments.php 6 years ago recent-posts-grid-carousel.php 6 years ago recent-posts-land-style.php 6 years ago recent-posts-masonry.php 6 years ago recent-posts-tiles-carousel.php 6 years ago recent-posts-tiles.php 6 years ago recent-posts-timeline.php 6 years ago recent-products.php 6 years ago search.php 6 years ago staff.php 6 years ago svg.php 6 years ago tabs.php 6 years ago testimonial.php 6 years ago text.php 6 years ago touch-slider.php 6 years ago video.php 6 years ago
recent-posts-tiles.php
679 lines
1 <?php
2 namespace Auxin\Plugin\CoreElements\Elementor\Elements;
3
4 use Elementor\Plugin;
5 use Elementor\Widget_Base;
6 use Elementor\Controls_Manager;
7 use Elementor\Group_Control_Typography;
8 use Elementor\Scheme_Typography;
9
10
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit; // Exit if accessed directly.
13 }
14
15 /**
16 * Elementor 'RecentPostsTiles' widget.
17 *
18 * Elementor widget that displays an 'RecentPostsTiles' with lightbox.
19 *
20 * @since 1.0.0
21 */
22 class RecentPostsTiles extends Widget_Base {
23
24 /**
25 * Get widget name.
26 *
27 * Retrieve 'RecentPostsTiles' widget name.
28 *
29 * @since 1.0.0
30 * @access public
31 *
32 * @return string Widget name.
33 */
34 public function get_name() {
35 return 'aux_recent_posts_tiles';
36 }
37
38 /**
39 * Get widget title.
40 *
41 * Retrieve 'RecentPostsTiles' widget title.
42 *
43 * @since 1.0.0
44 * @access public
45 *
46 * @return string Widget title.
47 */
48 public function get_title() {
49 return __('Tiles Posts', 'auxin-elements' );
50 }
51
52 /**
53 * Get widget icon.
54 *
55 * Retrieve 'RecentPostsTiles' widget icon.
56 *
57 * @since 1.0.0
58 * @access public
59 *
60 * @return string Widget icon.
61 */
62 public function get_icon() {
63 return 'eicon-posts-group auxin-badge';
64 }
65
66 /**
67 * Get widget categories.
68 *
69 * Retrieve 'RecentPostsTiles' widget icon.
70 *
71 * @since 1.0.0
72 * @access public
73 *
74 * @return string Widget icon.
75 */
76 public function get_categories() {
77 return array( 'auxin-dynamic' );
78 }
79
80 /**
81 * Retrieve the terms in a given taxonomy or list of taxonomies.
82 *
83 * Retrieve 'RecentPostsTiles' widget icon.
84 *
85 * @since 1.0.0
86 * @access public
87 *
88 * @return string Widget icon.
89 */
90 public function get_terms() {
91 $terms = get_terms( 'category', 'orderby=count&hide_empty=0' );
92 $list = array( ' ' => __('All Categories', 'auxin-elements' ) ) ;
93 foreach ( $terms as $key => $value ) {
94 $list[$value->term_id] = $value->name;
95 }
96
97 return $list;
98 }
99
100 /**
101 * Register 'RecentPostsTiles' widget controls.
102 *
103 * Adds different input fields to allow the user to change and customize the widget settings.
104 *
105 * @since 1.0.0
106 * @access protected
107 */
108 protected function _register_controls() {
109
110 /*-----------------------------------------------------------------------------------*/
111 /* layout_section
112 /*-----------------------------------------------------------------------------------*/
113
114 $this->start_controls_section(
115 'layout_section',
116 array(
117 'label' => __('Layout', 'auxin-elements' ),
118 'tab' => Controls_Manager::TAB_LAYOUT
119 )
120 );
121
122 $this->add_control(
123 'tile_style_pattern',
124 array(
125 'label' => __('Post Tile styles','auxin-elements' ),
126 'type' => 'aux-visual-select',
127 'default' => 'default',
128 'options' => array(
129 'default' => array(
130 'label' => __( 'Default', 'auxin-elements' ),
131 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-5.svg'
132 ),
133 'pattern-1' => array(
134 'label' => __( 'Pattern 1', 'auxin-elements' ),
135 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-3.svg'
136 ),
137 'pattern-2' => array(
138 'label' => __( 'Pattern 2', 'auxin-elements' ),
139 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-6.svg'
140 ),
141 'pattern-3' => array(
142 'label' => __( 'Pattern 3', 'auxin-elements' ),
143 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-7.svg'
144 ),
145 'pattern-4' => array(
146 'label' => __( 'Pattern 4', 'auxin-elements' ),
147 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-8.svg'
148 ),
149 'pattern-5' => array(
150 'label' => __( 'Pattern 5', 'auxin-elements' ),
151 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-4.svg'
152 ),
153 'pattern-6' => array(
154 'label' => __('Pattern 6', 'auxin-elements' ),
155 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-1.svg'
156 ),
157 'pattern-7' => array(
158 'label' => __('Pattern 7', 'auxin-elements' ),
159 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-2.svg'
160 )
161 )
162 )
163 );
164
165 $this->add_control(
166 'tile_style',
167 array(
168 'label' => __('Post tile style','auxin-elements' ),
169 'type' => 'aux-visual-select',
170 'default' => '',
171 'options' => array(
172 '' => array(
173 'label' => __('Standard', 'auxin-elements' ),
174 'image' => AUXIN_URL . 'images/visual-select/button-normal.svg'
175 ),
176 'aux-overlay' => array(
177 'label' => __('Dark', 'auxin-elements' ),
178 'image' => AUXIN_URL . 'images/visual-select/button-curved.svg'
179 )
180 )
181 )
182 );
183
184 $this->end_controls_section();
185
186 /*-----------------------------------------------------------------------------------*/
187 /* display_section
188 /*-----------------------------------------------------------------------------------*/
189
190 $this->start_controls_section(
191 'display_section',
192 array(
193 'label' => __('Display', 'auxin-elements' ),
194 'tab' => Controls_Manager::TAB_LAYOUT
195 )
196 );
197
198 $this->add_control(
199 'display_title',
200 array(
201 'label' => __('Display post title', 'auxin-elements' ),
202 'type' => Controls_Manager::SWITCHER,
203 'label_on' => __( 'On', 'auxin-elements' ),
204 'label_off' => __( 'Off', 'auxin-elements' ),
205 'return_value' => 'yes',
206 'default' => 'yes'
207 )
208 );
209
210 $this->add_control(
211 'show_info',
212 array(
213 'label' => __('Display post info','auxin-elements' ),
214 'type' => Controls_Manager::SWITCHER,
215 'label_on' => __( 'On', 'auxin-elements' ),
216 'label_off' => __( 'Off', 'auxin-elements' ),
217 'return_value' => 'yes',
218 'default' => 'yes'
219 )
220 );
221
222 $this->end_controls_section();
223
224 /*-----------------------------------------------------------------------------------*/
225 /* query_section
226 /*-----------------------------------------------------------------------------------*/
227
228 $this->start_controls_section(
229 'query_section',
230 array(
231 'label' => __('Query', 'auxin-elements' ),
232 )
233 );
234
235 $this->add_control(
236 'cat',
237 array(
238 'label' => __('Categories', 'auxin-elements'),
239 'description' => __('Specifies a category that you want to show posts from it.', 'auxin-elements' ),
240 'type' => Controls_Manager::SELECT2,
241 'multiple' => true,
242 'options' => $this->get_terms(),
243 'default' => array( ' ' ),
244 )
245 );
246
247 $this->add_control(
248 'num',
249 array(
250 'label' => __('Number of posts to show', 'auxin-elements'),
251 'label_block' => true,
252 'type' => Controls_Manager::NUMBER,
253 'default' => '8',
254 'min' => 1,
255 'step' => 1
256 )
257 );
258
259 $this->add_control(
260 'exclude_without_media',
261 array(
262 'label' => __('Exclude posts without media','auxin-elements' ),
263 'type' => Controls_Manager::SWITCHER,
264 'label_on' => __( 'On', 'auxin-elements' ),
265 'label_off' => __( 'Off', 'auxin-elements' ),
266 'return_value' => 'yes',
267 'default' => 'no'
268 )
269 );
270
271 $this->add_control(
272 'exclude_custom_post_formats',
273 array(
274 'label' => __('Exclude custom post formats','auxin-elements' ),
275 'type' => Controls_Manager::SWITCHER,
276 'label_on' => __( 'On', 'auxin-elements' ),
277 'label_off' => __( 'Off', 'auxin-elements' ),
278 'return_value' => 'yes',
279 'default' => 'no',
280 )
281 );
282
283 $this->add_control(
284 'exclude_quote_link',
285 array(
286 'label' => __('Exclude quote and link post formats','auxin-elements' ),
287 'type' => Controls_Manager::SWITCHER,
288 'label_on' => __( 'On', 'auxin-elements' ),
289 'label_off' => __( 'Off', 'auxin-elements' ),
290 'return_value' => 'yes',
291 'default' => 'no',
292 'condition' => array(
293 'exclude_custom_post_formats' => 'yes',
294 )
295 )
296 );
297
298 $this->add_control(
299 'order_by',
300 array(
301 'label' => __('Order by', 'auxin-elements'),
302 'type' => Controls_Manager::SELECT,
303 'default' => 'date',
304 'options' => array(
305 'date' => __('Date', 'auxin-elements'),
306 'menu_order date' => __('Menu Order', 'auxin-elements'),
307 'title' => __('Title', 'auxin-elements'),
308 'ID' => __('ID', 'auxin-elements'),
309 'rand' => __('Random', 'auxin-elements'),
310 'comment_count' => __('Comments', 'auxin-elements'),
311 'modified' => __('Date Modified', 'auxin-elements'),
312 'author' => __('Author', 'auxin-elements'),
313 'post__in' => __('Inserted Post IDs', 'auxin-elements')
314 ),
315 )
316 );
317
318 $this->add_control(
319 'order',
320 array(
321 'label' => __('Order', 'auxin-elements'),
322 'type' => Controls_Manager::SELECT,
323 'default' => 'DESC',
324 'options' => array(
325 'DESC' => __('Descending', 'auxin-elements'),
326 'ASC' => __('Ascending', 'auxin-elements'),
327 ),
328 )
329 );
330
331 $this->add_control(
332 'only_posts__in',
333 array(
334 'label' => __('Only posts','auxin-elements' ),
335 'description' => __('If you intend to display ONLY specific posts, you should specify the posts here. You have to insert the post IDs that are separated by comma (eg. 53,34,87,25).', 'auxin-elements' ),
336 'type' => Controls_Manager::TEXT
337 )
338 );
339
340 $this->add_control(
341 'include',
342 array(
343 'label' => __('Include posts','auxin-elements' ),
344 'description' => __('If you intend to include additional posts, you should specify the posts here. You have to insert the Post IDs that are separated by comma (eg. 53,34,87,25)', 'auxin-elements' ),
345 'type' => Controls_Manager::TEXT
346 )
347 );
348
349 $this->add_control(
350 'exclude',
351 array(
352 'label' => __('Exclude posts','auxin-elements' ),
353 'description' => __('If you intend to exclude specific posts from result, you should specify the posts here. You have to insert the Post IDs that are separated by comma (eg. 53,34,87,25)', 'auxin-elements' ),
354 'type' => Controls_Manager::TEXT
355 )
356 );
357
358 $this->add_control(
359 'offset',
360 array(
361 'label' => __('Start offset','auxin-elements' ),
362 'description' => __('Number of post to displace or pass over.', 'auxin-elements' ),
363 'type' => Controls_Manager::NUMBER
364 )
365 );
366
367 $this->end_controls_section();
368
369 /*-----------------------------------------------------------------------------------*/
370 /* paginate_section
371 /*-----------------------------------------------------------------------------------*/
372
373 $this->start_controls_section(
374 'paginate_section',
375 array(
376 'label' => __('Paginate', 'auxin-elements' ),
377 )
378 );
379
380 $this->add_control(
381 'loadmore_type',
382 array(
383 'label' => __('Load More Type','auxin-elements' ),
384 'type' => 'aux-visual-select',
385 'options' => array(
386 '' => array(
387 'label' => __('None', 'auxin-elements' ),
388 'image' => AUXIN_URL . 'images/visual-select/load-more-none.svg'
389 ),
390 'scroll' => array(
391 'label' => __('Infinite Scroll', 'auxin-elements' ),
392 'image' => AUXIN_URL . 'images/visual-select/load-more-infinite.svg'
393 ),
394 'next' => array(
395 'label' => __('Next Button', 'auxin-elements' ),
396 'image' => AUXIN_URL . 'images/visual-select/load-more-button.svg'
397 ),
398 'next-prev' => array(
399 'label' => __('Next Prev', 'auxin-elements' ),
400 'image' => AUXIN_URL . 'images/visual-select/load-more-next-prev.svg'
401 )
402 ),
403 'default' => ''
404 )
405 );
406
407 $this->end_controls_section();
408
409 /*-----------------------------------------------------------------------------------*/
410 /* title_style_section
411 /*-----------------------------------------------------------------------------------*/
412
413 $this->start_controls_section(
414 'title_style_section',
415 array(
416 'label' => __( 'Title', 'auxin-elements' ),
417 'tab' => Controls_Manager::TAB_STYLE,
418 'condition' => array(
419 'display_title' => 'yes',
420 ),
421 )
422 );
423
424 $this->start_controls_tabs( 'title_colors' );
425
426 $this->start_controls_tab(
427 'title_color_normal',
428 array(
429 'label' => __( 'Normal' , 'auxin-elements' ),
430 'condition' => array(
431 'display_title' => 'yes',
432 ),
433 )
434 );
435
436 $this->add_control(
437 'title_color',
438 array(
439 'label' => __( 'Color', 'auxin-elements' ),
440 'type' => Controls_Manager::COLOR,
441 'selectors' => array(
442 '{{WRAPPER}} .entry-title a' => 'color: {{VALUE}};',
443 ),
444 'condition' => array(
445 'display_title' => 'yes',
446 ),
447 )
448 );
449
450 $this->end_controls_tab();
451
452 $this->start_controls_tab(
453 'title_color_hover',
454 array(
455 'label' => __( 'Hover' , 'auxin-elements' ),
456 'condition' => array(
457 'display_title' => 'yes',
458 ),
459 )
460 );
461
462 $this->add_control(
463 'title_hover_color',
464 array(
465 'label' => __( 'Color', 'auxin-elements' ),
466 'type' => Controls_Manager::COLOR,
467 'selectors' => array(
468 '{{WRAPPER}} .entry-title a:hover' => 'color: {{VALUE}};',
469 ),
470 'condition' => array(
471 'display_title' => 'yes',
472 ),
473 )
474 );
475
476 $this->end_controls_tab();
477
478 $this->end_controls_tabs();
479
480 $this->add_group_control(
481 Group_Control_Typography::get_type(),
482 array(
483 'name' => 'title_typography',
484 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
485 'selector' => '{{WRAPPER}} .entry-title',
486 'condition' => array(
487 'display_title' => 'yes',
488 ),
489 )
490 );
491
492 $this->add_responsive_control(
493 'title_margin_bottom',
494 array(
495 'label' => __( 'Bottom space', 'auxin-elements' ),
496 'type' => Controls_Manager::SLIDER,
497 'range' => array(
498 'px' => array(
499 'max' => 100,
500 ),
501 ),
502 'selectors' => array(
503 '{{WRAPPER}} .entry-title' => 'margin-bottom: {{SIZE}}{{UNIT}};',
504 ),
505 'condition' => array(
506 'display_title' => 'yes',
507 ),
508 )
509 );
510
511 $this->end_controls_section();
512
513 /*-----------------------------------------------------------------------------------*/
514 /* info_style_section
515 /*-----------------------------------------------------------------------------------*/
516
517 $this->start_controls_section(
518 'info_style_section',
519 array(
520 'label' => __( 'Post Info', 'auxin-elements' ),
521 'tab' => Controls_Manager::TAB_STYLE,
522 'condition' => array(
523 'show_info' => 'yes',
524 ),
525 )
526 );
527
528 $this->start_controls_tabs( 'info_colors' );
529
530 $this->start_controls_tab(
531 'info_color_normal',
532 array(
533 'label' => __( 'Normal' , 'auxin-elements' ),
534 'condition' => array(
535 'show_info' => 'yes',
536 ),
537 )
538 );
539
540 $this->add_control(
541 'info_color',
542 array(
543 'label' => __( 'Color', 'auxin-elements' ),
544 'type' => Controls_Manager::COLOR,
545 'selectors' => array(
546 '{{WRAPPER}} .entry-info a, {{WRAPPER}} .entry-info' => 'color: {{VALUE}};',
547 ),
548 'condition' => array(
549 'show_info' => 'yes',
550 ),
551 )
552 );
553
554 $this->end_controls_tab();
555
556 $this->start_controls_tab(
557 'info_color_hover',
558 array(
559 'label' => __( 'Hover' , 'auxin-elements' ),
560 'condition' => array(
561 'show_info' => 'yes',
562 ),
563 )
564 );
565
566 $this->add_control(
567 'info_hover_color',
568 array(
569 'label' => __( 'Color', 'auxin-elements' ),
570 'type' => Controls_Manager::COLOR,
571 'selectors' => array(
572 '{{WRAPPER}} .entry-info a:hover' => 'color: {{VALUE}};',
573 ),
574 'condition' => array(
575 'show_info' => 'yes',
576 ),
577 )
578 );
579
580 $this->end_controls_tab();
581
582 $this->end_controls_tabs();
583
584 $this->add_group_control(
585 Group_Control_Typography::get_type(),
586 array(
587 'name' => 'info_typography',
588 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
589 'selector' => '{{WRAPPER}} .entry-info, {{WRAPPER}} .entry-info a',
590 'condition' => array(
591 'show_info' => 'yes',
592 ),
593 )
594 );
595
596 $this->add_responsive_control(
597 'info_margin_bottom',
598 array(
599 'label' => __( 'Bottom space', 'auxin-elements' ),
600 'type' => Controls_Manager::SLIDER,
601 'range' => array(
602 'px' => array(
603 'max' => 100
604 )
605 ),
606 'selectors' => array(
607 '{{WRAPPER}} .entry-info' => 'margin-bottom: {{SIZE}}{{UNIT}};'
608 ),
609 'condition' => array(
610 'show_info' => 'yes'
611 )
612 )
613 );
614
615 $this->add_responsive_control(
616 'info_spacing_between',
617 array(
618 'label' => __( 'Space between metas', 'auxin-elements' ),
619 'type' => Controls_Manager::SLIDER,
620 'range' => array(
621 'px' => array(
622 'max' => 30
623 )
624 ),
625 'selectors' => array(
626 '{{WRAPPER}} .entry-info [class^="entry-"] + [class^="entry-"]:before, {{WRAPPER}} .entry-info .entry-tax a:after' =>
627 'margin-right: {{SIZE}}{{UNIT}}; margin-left: {{SIZE}}{{UNIT}};'
628 ),
629 'condition' => array(
630 'show_info' => 'yes'
631 )
632 )
633 );
634
635 $this->end_controls_section();
636 }
637
638 /**
639 * Render image box widget output on the frontend.
640 *
641 * Written in PHP and used to generate the final HTML.
642 *
643 * @since 1.0.0
644 * @access protected
645 */
646 protected function render() {
647
648 $settings = $this->get_settings_for_display();
649
650 $args = array(
651 // Display Section
652 'display_title' => $settings['display_title'],
653 'show_info' => $settings['show_info'],
654
655 // Layout section
656 'tile_style_pattern' => $settings['tile_style_pattern'],
657 'tile_style' => $settings['tile_style'],
658
659 // Query Section
660 'cat' => $settings['cat'],
661 'num' => $settings['num'],
662 'exclude_without_media' => $settings['exclude_without_media'],
663 'exclude_custom_post_formats' => $settings['exclude_custom_post_formats'],
664 'exclude_quote_link' => $settings['exclude_quote_link'],
665 'order_by' => $settings['order_by'],
666 'order' => $settings['order'],
667 'only_posts__in' => $settings['only_posts__in'],
668 'include' => $settings['include'],
669 'exclude' => $settings['exclude'],
670 'offset' => $settings['offset'],
671 'loadmore_type' => $settings['loadmore_type']
672 );
673
674 // get the shortcode base blog page
675 echo auxin_widget_recent_posts_tiles_callback( $args );
676 }
677
678 }
679