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