PluginProbe
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News / 2.2.10
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News v2.2.10
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 2.3.5 2.3.6 2.4.0 2.4.1 2.4.10 2.4.11 2.4.12 2.4.13 2.4.14 2.4.15 2.4.16 2.4.17 2.4.18 2.4.19 2.4.2 2.4.20 2.4.21 All 88 releases
← All changes | public/template/carousel.php +40 -48 4.0.8 → 2.2.10 View file →
@@ -6,9 +6,9 @@
6 6 * @subpackage Smart_Post_Show/public/template
7 7 */
8 8
9 9 if ( ! defined( 'ABSPATH' ) ) {
10 - exit; // Exit if accessed directly.
10 + exit;
11 11 }
12 12 $carousel_autoplay = ( isset( $view_options['pcp_autoplay'] ) && ( $view_options['pcp_autoplay'] ) ) ? 'true' : 'false';
13 13 $autoplay_speed = isset( $view_options['pcp_autoplay_speed'] ) ? $view_options['pcp_autoplay_speed'] : '';
14 14 $carousel_speed = isset( $view_options['pcp_carousel_speed'] ) ? $view_options['pcp_carousel_speed'] : '';
@@ -25,61 +25,53 @@
25 25 $accessibility_next_slide_text = isset( $pcp_settings['next_slide_message'] ) ? $pcp_settings['next_slide_message'] : '';
26 26 $accessibility_first_slide_text = isset( $pcp_settings['first_slide_message'] ) ? $pcp_settings['first_slide_message'] : '';
27 27 $accessibility_last_slide_text = isset( $pcp_settings['last_slide_message'] ) ? $pcp_settings['last_slide_message'] : '';
28 28 $accessibility_pagination_bullet_text = isset( $pcp_settings['pagination_bullet_message'] ) ? $pcp_settings['pagination_bullet_message'] : '';
29 -if ( 'slider_layout' === $layout_preset ) {
30 - $number_of_columns = array(
31 - 'lg_desktop' => '1',
32 - 'desktop' => '1',
33 - 'tablet' => '1',
34 - 'mobile_landscape' => '1',
35 - 'mobile' => '1',
36 - );
37 -}
38 29 if ( $pcp_settings['pcp_swiper_js'] ) {
39 30 wp_enqueue_script( 'pcp_swiper' );
40 31 }
41 32 // Navigation.
42 -$_navigation_data = isset( $view_options['pcp_navigation_data'] ) ? $view_options['pcp_navigation_data'] : array();
43 -$_navigation = isset( $_navigation_data['pcp_navigation'] ) ? $_navigation_data['pcp_navigation'] : true;
44 -$_navigation_on_mobile = isset( $_navigation_data['nev_hide_on_mobile'] ) ? $_navigation_data['nev_hide_on_mobile'] : false;
45 -if ( $_navigation ) {
46 - $navigation = 'true';
47 - $navigation_mobile = 'true';
48 -} elseif ( $_navigation && $_navigation_on_mobile ) {
49 - $navigation = 'true';
50 - $navigation_mobile = 'false';
51 -} else {
52 - $navigation = 'false';
53 - $navigation_mobile = 'false';
33 +$_navigation = isset( $view_options['pcp_navigation'] ) ? $view_options['pcp_navigation'] : '';
34 +switch ( $_navigation ) {
35 + case 'show':
36 + $navigation = 'true';
37 + $navigation_mobile = 'true';
38 + break;
39 + case 'hide':
40 + $navigation = 'false';
41 + $navigation_mobile = 'false';
42 + break;
43 + case 'hide_on_mobile':
44 + $navigation = 'true';
45 + $navigation_mobile = 'false';
46 + break;
54 47 }
55 48
56 49 // Pagination Settings.
57 -$_pagination_data = isset( $view_options['carousel_pagination_group'] ) ? $view_options['carousel_pagination_group'] : array();
58 -$_pagination = isset( $_pagination_data['pcp_pagination'] ) ? $_pagination_data['pcp_pagination'] : true;
59 -$_pagination_on_mobile = isset( $_pagination_data['pagination_hide_on_mobile'] ) ? $_pagination_data['pagination_hide_on_mobile'] : false;
60 -if ( $_pagination ) {
61 - $pagination = 'true';
62 - $pagination_mobile = 'true';
63 -} elseif ( $_pagination && $_pagination_on_mobile ) {
64 - $pagination = 'true';
65 - $pagination_mobile = 'false';
66 -} else {
67 - $pagination = 'false';
68 - $pagination_mobile = 'false';
50 +$_pagination = isset( $view_options['pcp_pagination'] ) ? $view_options['pcp_pagination'] : '';
51 +switch ( $_pagination ) {
52 + case 'show':
53 + $pagination = 'true';
54 + $pagination_mobile = 'true';
55 + break;
56 + case 'hide':
57 + $pagination = 'false';
58 + $pagination_mobile = 'false';
59 + break;
60 + case 'hide_on_mobile':
61 + $pagination = 'true';
62 + $pagination_mobile = 'false';
63 + break;
69 64 }
65 +$pcp_accessibility = ( isset( $view_options['pcp_accessibility'] ) && ( $view_options['pcp_accessibility'] ) ) ? 'true' : 'false';
66 +$touch_swipe = ( isset( $view_options['touch_swipe'] ) && ( $view_options['touch_swipe'] ) ) ? 'true' : 'false';
67 +$slider_draggable = ( isset( $view_options['slider_draggable'] ) && ( $view_options['slider_draggable'] ) ) ? 'true' : 'false';
68 +$slider_mouse_wheel = ( isset( $view_options['slider_mouse_wheel'] ) && ( $view_options['slider_mouse_wheel'] ) ) ? 'true' : 'false';
70 69
71 -$pcp_accessibility = ( isset( $view_options['pcp_accessibility'] ) && ( $view_options['pcp_accessibility'] ) ) ? 'true' : 'false';
72 -$touch_swipe = ( isset( $view_options['touch_swipe'] ) && ( $view_options['touch_swipe'] ) ) ? 'true' : 'false';
73 -$slider_draggable = ( isset( $view_options['slider_draggable'] ) && ( $view_options['slider_draggable'] ) ) ? 'true' : 'false';
74 -$free_mode = ( isset( $view_options['free_mode'] ) && $view_options['free_mode'] ) ? 'true' : 'false';
75 -$slider_mouse_wheel = ( isset( $view_options['slider_mouse_wheel'] ) && ( $view_options['slider_mouse_wheel'] ) ) ? 'true' : 'false';
76 -$carousel_nav_position = isset( $view_options['pcp_carousel_nav_position'] ) ? $view_options['pcp_carousel_nav_position'] : 'top_right';
77 -$bullet_types = ( isset( $view_options['bullet_types'] ) ) ? $view_options['bullet_types'] : 'dots';
78 -$dynamic_bullets = ( 'dynamic' === $bullet_types ) ? 'true' : 'false';
70 +
79 71 ?>
80 72 <!-- Markup Starts -->
81 -<div id="pcp_wrapper-<?php echo esc_html( $shortcode_id ); ?>" class="<?php self::pcp_wrapper_classes( $layout_preset, $shortcode_id ); ?> standard sp-<?php echo esc_attr( $layout_preset ); ?>" data-sid="<?php echo esc_html( $shortcode_id ); ?>">
73 +<div id="pcp_wrapper-<?php echo esc_html( $pcp_gl_id ); ?>" class="<?php self::pcp_wrapper_classes( $layout_preset, $pcp_gl_id ); ?> standard" data-sid="<?php echo esc_html( $pcp_gl_id ); ?>">
82 74 <?php if ( $show_preloader ) { ?>
83 75 <div id="pcp-preloader" class="pcp-preloader"></div>
84 76 <?php
85 77 }
@@ -84,15 +76,15 @@
84 76 <?php
85 77 }
86 78 if ( $view_options['section_title'] ) {
87 79 do_action( 'pcp_before_section_title' );
88 - SP_PC_HTML::pcp_section_title( $section_title );
80 + SP_PC_HTML::pcp_section_title( $pcp_gl_id );
89 81 do_action( 'pcp_after_section_title' );
90 82 }
91 83 ?>
92 - <div id="sp-pcp-id-<?php echo esc_html( $shortcode_id ); ?>" class="swiper-container sp-pcp-carousel <?php echo esc_attr( $carousel_nav_position ); ?>" dir="<?php echo esc_html( $carousel_direction ); ?>" data-carousel='{ "speed":<?php echo esc_html( $carousel_speed ); ?>, "items":<?php echo esc_html( $number_of_columns['lg_desktop'] ); ?>, "spaceBetween":<?php echo esc_html( $margin_between_post['left-right'] ); ?>, "dynamicBullets": <?php echo esc_html( $dynamic_bullets ); ?>, "navigation":<?php echo esc_html( $navigation ); ?>, "pagination": <?php echo esc_html( $pagination ); ?>, "autoplay": <?php echo esc_html( $carousel_autoplay ); ?>, "autoplay_speed": <?php echo esc_html( $autoplay_speed ); ?>, "loop": <?php echo esc_html( $infinite_loop ); ?>, "autoHeight": <?php echo esc_html( $carousel_auto_height ); ?>, "lazy": <?php echo esc_html( $lazy_load ); ?>, "simulateTouch": <?php echo esc_html( $slider_draggable ); ?>, "freeMode": <?php echo esc_html( $free_mode ); ?>, "slider_mouse_wheel": <?php echo esc_html( $slider_mouse_wheel ); ?>,"allowTouchMove": <?php echo esc_html( $touch_swipe ); ?>, "slidesPerView": {"lg_desktop": <?php echo esc_html( $number_of_columns['lg_desktop'] ); ?>, "desktop": <?php echo esc_html( $number_of_columns['desktop'] ); ?>, "tablet": <?php echo esc_html( $number_of_columns['tablet'] ); ?>, "mobile_landscape": <?php echo esc_html( $number_of_columns['mobile_landscape'] ); ?>, "mobile": <?php echo esc_html( $number_of_columns['mobile'] ); ?>}, "navigation_mobile": <?php echo esc_html( $navigation_mobile ); ?>, "pagination_mobile": <?php echo esc_html( $pagination_mobile ); ?>, "stop_onHover": <?php echo esc_html( $pause_hover ); ?>, "enabled": <?php echo esc_html( $is_carousel_accessibility ); ?>, "prevSlideMessage": "<?php echo esc_html( $accessibility_prev_slide_text ); ?>", "nextSlideMessage": "<?php echo esc_html( $accessibility_next_slide_text ); ?>", "firstSlideMessage": "<?php echo esc_html( $accessibility_first_slide_text ); ?>", "lastSlideMessage": "<?php echo esc_html( $accessibility_last_slide_text ); ?>", "keyboard": "<?php echo esc_html( $pcp_accessibility ); ?>", "paginationBulletMessage": "<?php echo esc_html( $accessibility_pagination_bullet_text ); ?>" }'>
84 + <div id="sp-pcp-id-<?php echo esc_html( $pcp_gl_id ); ?>" class="swiper-container sp-pcp-carousel top_right" dir="<?php echo esc_html( $carousel_direction ); ?>" data-carousel='{ "speed":<?php echo esc_html( $carousel_speed ); ?>, "items":<?php echo esc_html( $number_of_columns['lg_desktop'] ); ?>, "spaceBetween":<?php echo esc_html( $margin_between_post ); ?>, "navigation":<?php echo esc_html( $navigation ); ?>, "pagination": <?php echo esc_html( $pagination ); ?>, "autoplay": <?php echo esc_html( $carousel_autoplay ); ?>, "autoplay_speed": <?php echo esc_html( $autoplay_speed ); ?>, "loop": <?php echo esc_html( $infinite_loop ); ?>, "autoHeight": <?php echo esc_html( $carousel_auto_height ); ?>, "lazy": <?php echo esc_html( $lazy_load ); ?>, "simulateTouch": <?php echo esc_html( $slider_draggable ); ?>, "slider_mouse_wheel": <?php echo esc_html( $slider_mouse_wheel ); ?>,"allowTouchMove": <?php echo esc_html( $touch_swipe ); ?>, "slidesPerView": {"lg_desktop": <?php echo esc_html( $number_of_columns['lg_desktop'] ); ?>, "desktop": <?php echo esc_html( $number_of_columns['desktop'] ); ?>, "tablet": <?php echo esc_html( $number_of_columns['tablet'] ); ?>, "mobile_landscape": <?php echo esc_html( $number_of_columns['mobile_landscape'] ); ?>, "mobile": <?php echo esc_html( $number_of_columns['mobile'] ); ?>}, "navigation_mobile": <?php echo esc_html( $navigation_mobile ); ?>, "pagination_mobile": <?php echo esc_html( $pagination_mobile ); ?>, "stop_onHover": <?php echo esc_html( $pause_hover ); ?>, "enabled": <?php echo esc_html( $is_carousel_accessibility ); ?>, "prevSlideMessage": "<?php echo esc_html( $accessibility_prev_slide_text ); ?>", "nextSlideMessage": "<?php echo esc_html( $accessibility_next_slide_text ); ?>", "firstSlideMessage": "<?php echo esc_html( $accessibility_first_slide_text ); ?>", "lastSlideMessage": "<?php echo esc_html( $accessibility_last_slide_text ); ?>", "paginationBulletMessage": "<?php echo esc_html( $accessibility_pagination_bullet_text ); ?>" }'>
93 85 <div class="swiper-wrapper">
94 - <?php self::pcp_get_posts( $view_options, $layout_preset, $post_content_sorter, $pcp_query, $shortcode_id ); ?>
86 + <?php self::pcp_get_posts( $options, $layout_preset, $post_content_sorter, $pcp_query, $pcp_gl_id ); ?>
95 87 </div>
96 88 <?php
97 89 if ( 'true' === $pagination ) {
98 90 ?>
@@ -98,8 +90,8 @@
98 90 ?>
99 91 <div class="pcp-pagination swiper-pagination dots"></div>
100 92 <?php } ?>
101 93 <?php if ( 'true' === $navigation ) { ?>
102 - <div class="pcp-button-next swiper-button-next <?php echo esc_attr( $carousel_nav_position ); ?>"><i class="fa fa-angle-right"></i></div>
103 - <div class="pcp-button-prev swiper-button-prev <?php echo esc_attr( $carousel_nav_position ); ?>"><i class="fa fa-angle-left"></i></div><?php } ?>
94 + <div class="pcp-button-next swiper-button-next top_right"><i class="fa fa-angle-right"></i></div>
95 + <div class="pcp-button-prev swiper-button-prev top_right"><i class="fa fa-angle-left"></i></div><?php } ?>
104 96 </div>
105 97 </div>