PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / trunk
Shortcodes and extra features for Phlox theme vtrunk
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 months ago accordion.php 6 months ago audio.php 6 months ago before-after.php 6 months ago button.php 6 months ago carousel-navigation.php 6 months ago circle-chart.php 6 months ago contact-box.php 6 months ago contact-form.php 6 months ago custom-list.php 6 months ago divider.php 6 months ago gallery.php 6 months ago gmap.php 2 days ago heading-modern.php 5 months ago icon.php 6 months ago image.php 6 months ago mailchimp.php 6 months ago modern-button.php 6 months ago products-grid.php 6 months ago quote.php 6 months ago recent-comments.php 6 months ago recent-posts-grid-carousel.php 1 month ago recent-posts-land-style.php 6 months ago recent-posts-masonry.php 6 months ago recent-posts-tiles-carousel.php 6 months ago recent-posts-tiles.php 6 months ago recent-posts-timeline.php 6 months ago recent-products.php 6 months ago responsive-table.php 6 months ago search.php 6 months ago staff.php 6 months ago svg.php 6 months ago tabs.php 6 months ago testimonial.php 6 months ago text.php 6 months ago touch-slider.php 6 months ago video.php 6 months ago
recent-posts-tiles.php
693 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\Core\Kits\Documents\Tabs\Global_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 public function has_widget_inner_wrapper(): bool {
53 return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
54 }
55
56
57 /**
58 * Get widget icon.
59 *
60 * Retrieve 'RecentPostsTiles' widget icon.
61 *
62 * @since 1.0.0
63 * @access public
64 *
65 * @return string Widget icon.
66 */
67 public function get_icon() {
68 return 'eicon-posts-group auxin-badge';
69 }
70
71 /**
72 * Get widget categories.
73 *
74 * Retrieve 'RecentPostsTiles' widget icon.
75 *
76 * @since 1.0.0
77 * @access public
78 *
79 * @return string Widget icon.
80 */
81 public function get_categories() {
82 return array( 'auxin-dynamic' );
83 }
84
85 /**
86 * Retrieve the terms in a given taxonomy or list of taxonomies.
87 *
88 * Retrieve 'RecentPostsTiles' widget icon.
89 *
90 * @since 1.0.0
91 * @access public
92 *
93 * @return string Widget icon.
94 */
95 public function get_terms() {
96 $terms = get_terms([
97 'taxonomy' => 'category',
98 'orderby' => 'count',
99 'hide_empty' => false,
100 ]);
101
102 $list = array( ' ' => __('All Categories', 'auxin-elements' ) ) ;
103 foreach ( $terms as $key => $value ) {
104 $list[$value->term_id] = $value->name;
105 }
106
107 return $list;
108 }
109
110 /**
111 * Register 'RecentPostsTiles' widget controls.
112 *
113 * Adds different input fields to allow the user to change and customize the widget settings.
114 *
115 * @since 1.0.0
116 * @access protected
117 */
118 protected function register_controls() {
119
120 /*-----------------------------------------------------------------------------------*/
121 /* layout_section
122 /*-----------------------------------------------------------------------------------*/
123
124 $this->start_controls_section(
125 'layout_section',
126 array(
127 'label' => __('Layout', 'auxin-elements' ),
128 'tab' => Controls_Manager::TAB_LAYOUT
129 )
130 );
131
132 $this->add_control(
133 'tile_style_pattern',
134 array(
135 'label' => __('Post Tile styles','auxin-elements' ),
136 'type' => 'aux-visual-select',
137 'default' => 'default',
138 'options' => array(
139 'default' => array(
140 'label' => __( 'Default', 'auxin-elements' ),
141 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-5.svg'
142 ),
143 'pattern-1' => array(
144 'label' => __( 'Pattern 1', 'auxin-elements' ),
145 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-3.svg'
146 ),
147 'pattern-2' => array(
148 'label' => __( 'Pattern 2', 'auxin-elements' ),
149 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-6.svg'
150 ),
151 'pattern-3' => array(
152 'label' => __( 'Pattern 3', 'auxin-elements' ),
153 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-7.svg'
154 ),
155 'pattern-4' => array(
156 'label' => __( 'Pattern 4', 'auxin-elements' ),
157 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-8.svg'
158 ),
159 'pattern-5' => array(
160 'label' => __( 'Pattern 5', 'auxin-elements' ),
161 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-4.svg'
162 ),
163 'pattern-6' => array(
164 'label' => __('Pattern 6', 'auxin-elements' ),
165 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-1.svg'
166 ),
167 'pattern-7' => array(
168 'label' => __('Pattern 7', 'auxin-elements' ),
169 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-2.svg'
170 )
171 )
172 )
173 );
174
175 $this->add_control(
176 'tile_style',
177 array(
178 'label' => __('Post tile style','auxin-elements' ),
179 'type' => 'aux-visual-select',
180 'default' => '',
181 'options' => array(
182 '' => array(
183 'label' => __('Standard', 'auxin-elements' ),
184 'image' => AUXIN_URL . 'images/visual-select/button-normal.svg'
185 ),
186 'aux-overlay' => array(
187 'label' => __('Dark', 'auxin-elements' ),
188 'image' => AUXIN_URL . 'images/visual-select/button-curved.svg'
189 )
190 )
191 )
192 );
193
194 $this->end_controls_section();
195
196 /*-----------------------------------------------------------------------------------*/
197 /* display_section
198 /*-----------------------------------------------------------------------------------*/
199
200 $this->start_controls_section(
201 'display_section',
202 array(
203 'label' => __('Display', 'auxin-elements' ),
204 'tab' => Controls_Manager::TAB_LAYOUT
205 )
206 );
207
208 $this->add_control(
209 'display_title',
210 array(
211 'label' => __('Display post title', 'auxin-elements' ),
212 'type' => Controls_Manager::SWITCHER,
213 'label_on' => __( 'On', 'auxin-elements' ),
214 'label_off' => __( 'Off', 'auxin-elements' ),
215 'return_value' => 'yes',
216 'default' => 'yes'
217 )
218 );
219
220 $this->add_control(
221 'show_info',
222 array(
223 'label' => __('Display post info','auxin-elements' ),
224 'type' => Controls_Manager::SWITCHER,
225 'label_on' => __( 'On', 'auxin-elements' ),
226 'label_off' => __( 'Off', 'auxin-elements' ),
227 'return_value' => 'yes',
228 'default' => 'yes'
229 )
230 );
231
232 $this->end_controls_section();
233
234 /*-----------------------------------------------------------------------------------*/
235 /* query_section
236 /*-----------------------------------------------------------------------------------*/
237
238 $this->start_controls_section(
239 'query_section',
240 array(
241 'label' => __('Query', 'auxin-elements' ),
242 )
243 );
244
245 $this->add_control(
246 'cat',
247 array(
248 'label' => __('Categories', 'auxin-elements'),
249 'description' => __('Specifies a category that you want to show posts from it.', 'auxin-elements' ),
250 'type' => Controls_Manager::SELECT2,
251 'multiple' => true,
252 'options' => $this->get_terms(),
253 'default' => array( ' ' ),
254 )
255 );
256
257 $this->add_control(
258 'num',
259 array(
260 'label' => __('Number of posts to show', 'auxin-elements'),
261 'label_block' => true,
262 'type' => Controls_Manager::NUMBER,
263 'default' => '8',
264 'min' => 1,
265 'step' => 1
266 )
267 );
268
269 $this->add_control(
270 'exclude_without_media',
271 array(
272 'label' => __('Exclude posts without media','auxin-elements' ),
273 'type' => Controls_Manager::SWITCHER,
274 'label_on' => __( 'On', 'auxin-elements' ),
275 'label_off' => __( 'Off', 'auxin-elements' ),
276 'return_value' => 'yes',
277 'default' => 'no'
278 )
279 );
280
281 $this->add_control(
282 'exclude_custom_post_formats',
283 array(
284 'label' => __('Exclude custom post formats','auxin-elements' ),
285 'type' => Controls_Manager::SWITCHER,
286 'label_on' => __( 'On', 'auxin-elements' ),
287 'label_off' => __( 'Off', 'auxin-elements' ),
288 'return_value' => 'yes',
289 'default' => 'no',
290 )
291 );
292
293 $this->add_control(
294 'exclude_quote_link',
295 array(
296 'label' => __('Exclude quote and link post formats','auxin-elements' ),
297 'type' => Controls_Manager::SWITCHER,
298 'label_on' => __( 'On', 'auxin-elements' ),
299 'label_off' => __( 'Off', 'auxin-elements' ),
300 'return_value' => 'yes',
301 'default' => 'no',
302 'condition' => array(
303 'exclude_custom_post_formats' => 'yes',
304 )
305 )
306 );
307
308 $this->add_control(
309 'order_by',
310 array(
311 'label' => __('Order by', 'auxin-elements'),
312 'type' => Controls_Manager::SELECT,
313 'default' => 'date',
314 'options' => array(
315 'date' => __('Date', 'auxin-elements'),
316 'menu_order date' => __('Menu Order', 'auxin-elements'),
317 'title' => __('Title', 'auxin-elements'),
318 'ID' => __('ID', 'auxin-elements'),
319 'rand' => __('Random', 'auxin-elements'),
320 'comment_count' => __('Comments', 'auxin-elements'),
321 'modified' => __('Date Modified', 'auxin-elements'),
322 'author' => __('Author', 'auxin-elements'),
323 'post__in' => __('Inserted Post IDs', 'auxin-elements')
324 ),
325 )
326 );
327
328 $this->add_control(
329 'order',
330 array(
331 'label' => __('Order', 'auxin-elements'),
332 'type' => Controls_Manager::SELECT,
333 'default' => 'DESC',
334 'options' => array(
335 'DESC' => __('Descending', 'auxin-elements'),
336 'ASC' => __('Ascending', 'auxin-elements'),
337 ),
338 )
339 );
340
341 $this->add_control(
342 'only_posts__in',
343 array(
344 'label' => __('Only posts','auxin-elements' ),
345 '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' ),
346 'type' => Controls_Manager::TEXT
347 )
348 );
349
350 $this->add_control(
351 'include',
352 array(
353 'label' => __('Include posts','auxin-elements' ),
354 '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' ),
355 'type' => Controls_Manager::TEXT
356 )
357 );
358
359 $this->add_control(
360 'exclude',
361 array(
362 'label' => __('Exclude posts','auxin-elements' ),
363 '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' ),
364 'type' => Controls_Manager::TEXT
365 )
366 );
367
368 $this->add_control(
369 'offset',
370 array(
371 'label' => __('Start offset','auxin-elements' ),
372 'description' => __('Number of post to displace or pass over.', 'auxin-elements' ),
373 'type' => Controls_Manager::NUMBER
374 )
375 );
376
377 $this->end_controls_section();
378
379 /*-----------------------------------------------------------------------------------*/
380 /* paginate_section
381 /*-----------------------------------------------------------------------------------*/
382
383 $this->start_controls_section(
384 'paginate_section',
385 array(
386 'label' => __('Paginate', 'auxin-elements' ),
387 )
388 );
389
390 $this->add_control(
391 'loadmore_type',
392 array(
393 'label' => __('Load More Type','auxin-elements' ),
394 'type' => 'aux-visual-select',
395 'options' => array(
396 '' => array(
397 'label' => __('None', 'auxin-elements' ),
398 'image' => AUXIN_URL . 'images/visual-select/load-more-none.svg'
399 ),
400 'scroll' => array(
401 'label' => __('Infinite Scroll', 'auxin-elements' ),
402 'image' => AUXIN_URL . 'images/visual-select/load-more-infinite.svg'
403 ),
404 'next' => array(
405 'label' => __('Next Button', 'auxin-elements' ),
406 'image' => AUXIN_URL . 'images/visual-select/load-more-button.svg'
407 ),
408 'next-prev' => array(
409 'label' => __('Next Prev', 'auxin-elements' ),
410 'image' => AUXIN_URL . 'images/visual-select/load-more-next-prev.svg'
411 )
412 ),
413 'default' => ''
414 )
415 );
416
417 $this->end_controls_section();
418
419 /*-----------------------------------------------------------------------------------*/
420 /* title_style_section
421 /*-----------------------------------------------------------------------------------*/
422
423 $this->start_controls_section(
424 'title_style_section',
425 array(
426 'label' => __( 'Title', 'auxin-elements' ),
427 'tab' => Controls_Manager::TAB_STYLE,
428 'condition' => array(
429 'display_title' => 'yes',
430 ),
431 )
432 );
433
434 $this->start_controls_tabs( 'title_colors' );
435
436 $this->start_controls_tab(
437 'title_color_normal',
438 array(
439 'label' => __( 'Normal' , 'auxin-elements' ),
440 'condition' => array(
441 'display_title' => 'yes',
442 ),
443 )
444 );
445
446 $this->add_control(
447 'title_color',
448 array(
449 'label' => __( 'Color', 'auxin-elements' ),
450 'type' => Controls_Manager::COLOR,
451 'selectors' => array(
452 '{{WRAPPER}} .entry-title a' => 'color: {{VALUE}};',
453 ),
454 'condition' => array(
455 'display_title' => 'yes',
456 ),
457 )
458 );
459
460 $this->end_controls_tab();
461
462 $this->start_controls_tab(
463 'title_color_hover',
464 array(
465 'label' => __( 'Hover' , 'auxin-elements' ),
466 'condition' => array(
467 'display_title' => 'yes',
468 ),
469 )
470 );
471
472 $this->add_control(
473 'title_hover_color',
474 array(
475 'label' => __( 'Color', 'auxin-elements' ),
476 'type' => Controls_Manager::COLOR,
477 'selectors' => array(
478 '{{WRAPPER}} .entry-title a:hover' => 'color: {{VALUE}};',
479 ),
480 'condition' => array(
481 'display_title' => 'yes',
482 ),
483 )
484 );
485
486 $this->end_controls_tab();
487
488 $this->end_controls_tabs();
489
490 $this->add_group_control(
491 Group_Control_Typography::get_type(),
492 array(
493 'name' => 'title_typography',
494 'global' => [
495 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
496 ],
497 'selector' => '{{WRAPPER}} .entry-title',
498 'condition' => array(
499 'display_title' => 'yes',
500 ),
501 )
502 );
503
504 $this->add_responsive_control(
505 'title_margin_bottom',
506 array(
507 'label' => __( 'Bottom space', 'auxin-elements' ),
508 'type' => Controls_Manager::SLIDER,
509 'range' => array(
510 'px' => array(
511 'max' => 100,
512 ),
513 ),
514 'selectors' => array(
515 '{{WRAPPER}} .entry-title' => 'margin-bottom: {{SIZE}}{{UNIT}};',
516 ),
517 'condition' => array(
518 'display_title' => 'yes',
519 ),
520 )
521 );
522
523 $this->end_controls_section();
524
525 /*-----------------------------------------------------------------------------------*/
526 /* info_style_section
527 /*-----------------------------------------------------------------------------------*/
528
529 $this->start_controls_section(
530 'info_style_section',
531 array(
532 'label' => __( 'Post Info', 'auxin-elements' ),
533 'tab' => Controls_Manager::TAB_STYLE,
534 'condition' => array(
535 'show_info' => 'yes',
536 ),
537 )
538 );
539
540 $this->start_controls_tabs( 'info_colors' );
541
542 $this->start_controls_tab(
543 'info_color_normal',
544 array(
545 'label' => __( 'Normal' , 'auxin-elements' ),
546 'condition' => array(
547 'show_info' => 'yes',
548 ),
549 )
550 );
551
552 $this->add_control(
553 'info_color',
554 array(
555 'label' => __( 'Color', 'auxin-elements' ),
556 'type' => Controls_Manager::COLOR,
557 'selectors' => array(
558 '{{WRAPPER}} .entry-info a, {{WRAPPER}} .entry-info' => 'color: {{VALUE}};',
559 ),
560 'condition' => array(
561 'show_info' => 'yes',
562 ),
563 )
564 );
565
566 $this->end_controls_tab();
567
568 $this->start_controls_tab(
569 'info_color_hover',
570 array(
571 'label' => __( 'Hover' , 'auxin-elements' ),
572 'condition' => array(
573 'show_info' => 'yes',
574 ),
575 )
576 );
577
578 $this->add_control(
579 'info_hover_color',
580 array(
581 'label' => __( 'Color', 'auxin-elements' ),
582 'type' => Controls_Manager::COLOR,
583 'selectors' => array(
584 '{{WRAPPER}} .entry-info a:hover' => 'color: {{VALUE}};',
585 ),
586 'condition' => array(
587 'show_info' => 'yes',
588 ),
589 )
590 );
591
592 $this->end_controls_tab();
593
594 $this->end_controls_tabs();
595
596 $this->add_group_control(
597 Group_Control_Typography::get_type(),
598 array(
599 'name' => 'info_typography',
600 'global' => [
601 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
602 ],
603 'selector' => '{{WRAPPER}} .entry-info, {{WRAPPER}} .entry-info a',
604 'condition' => array(
605 'show_info' => 'yes',
606 ),
607 )
608 );
609
610 $this->add_responsive_control(
611 'info_margin_bottom',
612 array(
613 'label' => __( 'Bottom space', 'auxin-elements' ),
614 'type' => Controls_Manager::SLIDER,
615 'range' => array(
616 'px' => array(
617 'max' => 100
618 )
619 ),
620 'selectors' => array(
621 '{{WRAPPER}} .entry-info' => 'margin-bottom: {{SIZE}}{{UNIT}};'
622 ),
623 'condition' => array(
624 'show_info' => 'yes'
625 )
626 )
627 );
628
629 $this->add_responsive_control(
630 'info_spacing_between',
631 array(
632 'label' => __( 'Space between metas', 'auxin-elements' ),
633 'type' => Controls_Manager::SLIDER,
634 'range' => array(
635 'px' => array(
636 'max' => 30
637 )
638 ),
639 'selectors' => array(
640 '{{WRAPPER}} .entry-info [class^="entry-"] + [class^="entry-"]:before, {{WRAPPER}} .entry-info .entry-tax a:after' =>
641 'margin-right: {{SIZE}}{{UNIT}}; margin-left: {{SIZE}}{{UNIT}};'
642 ),
643 'condition' => array(
644 'show_info' => 'yes'
645 )
646 )
647 );
648
649 $this->end_controls_section();
650 }
651
652 /**
653 * Render image box widget output on the frontend.
654 *
655 * Written in PHP and used to generate the final HTML.
656 *
657 * @since 1.0.0
658 * @access protected
659 */
660 protected function render() {
661
662 $settings = $this->get_settings_for_display();
663
664 $args = array(
665 // Display Section
666 'display_title' => $settings['display_title'],
667 'show_info' => $settings['show_info'],
668
669 // Layout section
670 'tile_style_pattern' => $settings['tile_style_pattern'],
671 'tile_style' => $settings['tile_style'],
672
673 // Query Section
674 'cat' => $settings['cat'],
675 'num' => $settings['num'],
676 'exclude_without_media' => $settings['exclude_without_media'],
677 'exclude_custom_post_formats' => $settings['exclude_custom_post_formats'],
678 'exclude_quote_link' => $settings['exclude_quote_link'],
679 'order_by' => $settings['order_by'],
680 'order' => $settings['order'],
681 'only_posts__in' => $settings['only_posts__in'],
682 'include' => $settings['include'],
683 'exclude' => $settings['exclude'],
684 'offset' => $settings['offset'],
685 'loadmore_type' => $settings['loadmore_type']
686 );
687
688 // get the shortcode base blog page
689 echo auxin_widget_recent_posts_tiles_callback( $args );
690 }
691
692 }
693