PluginProbe
GutSlider – All in One Slider and Carousel Blocks for Gutenberg / 2.9.9
GutSlider – All in One Slider and Carousel Blocks for Gutenberg v2.9.9
3.2.0 3.1.0 3.0.0 2.13.2 2.13.1 2.13.0 trunk 1.0.0 2.1.0 2.10.0 2.10.1 2.11.0 2.11.1 2.11.2 2.11.3 2.11.4 2.12.0 2.2.1 2.2.2 2.3.0 2.4.0 2.5.1 2.5.3 2.5.4 2.5.5 All 57 releases
← All changes | build/blocks/post-slider/render.php +6 -41 2.11.3 → 2.9.9 View file →
@@ -40,13 +40,9 @@
40 40 'navPrevIcon' => 'arrowLeft',
41 41 'navNextIcon' => 'arrowRight',
42 42 'customPrevSVG' => '',
43 43 'customNextSVG' => '',
44 - 'excerptLength' => 20,
45 - 'enableRemoteNav' => false,
46 - 'remotePrevSelector' => '',
47 - 'remoteNextSelector' => '',
48 - 'detachContent' => false, // New attribute for detaching content
44 + 'excerptLength' => 20
49 45 ];
50 46
51 47 $atts = wp_parse_args( $attributes, $defaults );
52 48
@@ -73,21 +69,10 @@
73 69 'swiper-slide',
74 70 $atts['sliderType'] === 'slider' ? 'slide-mode' : ''
75 71 ];
76 72
77 - if ( ! empty( $atts['detachContent'] ) ) {
78 - $swiper_classes[] = 'detach-content';
79 - }
80 -
81 73 ?>
82 - <div <?php echo wp_kses_post( $block_props ); ?> data-swiper-options="<?php echo esc_attr( wp_json_encode( $atts['sliderOptions'] ) ); ?>"
83 - <?php
84 - if ( $atts['enableRemoteNav'] ) {
85 - echo 'data-rprev="' . esc_attr( $atts['remotePrevSelector'] ) . '" ';
86 - echo 'data-rnext="' . esc_attr( $atts['remoteNextSelector'] ) . '" ';
87 - }
88 - ?>
89 - >
74 + <div <?php echo wp_kses_post( $block_props ); ?> data-swiper-options="<?php echo esc_attr( wp_json_encode( $atts['sliderOptions'] ) ); ?>">
90 75 <div class="swiper">
91 76 <div class="swiper-wrapper">
92 77 <?php
93 78 if ( is_array( $atts['queryPosts'] ) && ! empty( $atts['queryPosts'] ) ) {
@@ -106,35 +91,15 @@
106 91 : 'background-position: center center;';
107 92 $bg_style = $post_image ? sprintf( 'background-image: url(%s); %s', esc_url( $post_image ), $bg_position ) : $bg_position;
108 93 $post_categories = isset( $post['categories'] ) ? $post['categories'] : [];
109 94
110 - // create object-position style
111 - $object_position = isset( $focusPoints[$index - 1] ) && isset( $focusPoints[$index - 1]['x'] ) && isset( $focusPoints[$index - 1]['y'] )
112 - ? sprintf( 'object-position: %d%% %d%%;', round( $focusPoints[$index - 1]['x'] * 100 ), round( $focusPoints[$index - 1]['y'] * 100 ) )
113 - : 'object-position: center center;';
114 -
115 95 ?>
116 96 <div class="<?php echo esc_attr( implode( ' ', $swiper_classes ) ); ?>">
117 - <div class="swiper-container-outer"
118 - <?php if ( ! $atts['detachContent'] ) : ?>
119 - style="<?php echo esc_attr( $bg_style ); ?>"
120 - <?php endif; ?>
121 - >
97 + <div class="swiper-container-outer" style="<?php echo esc_attr( $bg_style ); ?>">
122 98 <?php if ( $atts['enableOverlay'] ) : ?>
123 99 <div class="gutslider-overlay"></div>
124 100 <?php endif; ?>
125 - <?php
126 - if ( $atts['detachContent'] && $post_image ) {
127 - ?>
128 - <a class="detached-featured-image" href="<?php echo esc_url( $post_link ); ?>">
129 - <img src="<?php echo esc_url( $post_image ); ?>" alt="<?php echo esc_attr( $post_title ); ?>"
130 - style="<?php echo esc_attr( $object_position ); ?>"
131 - />
132 - </a>
133 - <?php
134 - }
135 - ?>
136 - <div class="gutslider-content-wrapper<?php echo $atts['detachContent'] ? ' detach-content' : ''; ?>">
101 + <div class="gutslider-content-wrapper">
137 102 <div class="gutslider-content-inner">
138 103 <?php if ( $atts['showCat'] ) : ?>
139 104 <div class="post-categories <?php echo esc_attr( $atts['catAnimation'] ); ?>">
140 105 <?php
@@ -197,9 +162,9 @@
197 162 }
198 163 ?>
199 164 </div>
200 165 <?php
201 - if( $atts['showNavigation'] === '1' && $atts['navContainerPosition'] === 'nav_inside' && $atts['enableRemoteNav'] !== '1' ) {
166 + if( $atts['showNavigation'] === '1' && $atts['navContainerPosition'] === 'nav_inside' ) {
202 167 ?>
203 168 <div class="gutslider-nav nav_inside <?php echo esc_attr( $atts['navPosition'] ); ?>">
204 169 <?php if ( $atts['customNavIcon'] ) : ?>
205 170 <div class="gutslider-prev">
@@ -240,9 +205,9 @@
240 205 }
241 206 ?>
242 207 </div>
243 208 <?php
244 - if ( $atts['showNavigation'] === '1' && $atts['navContainerPosition'] === 'nav_outside' && $atts['enableRemoteNav'] !== '1' ) : ?>
209 + if ( $atts['showNavigation'] === '1' && $atts['navContainerPosition'] === 'nav_outside' ) : ?>
245 210 <div class="gutslider-nav nav_outside <?php echo esc_attr( $atts['navPosition'] ); ?>">
246 211 <?php if ( $atts['customNavIcon'] ) : ?>
247 212 <div class="gutslider-prev">
248 213 <!-- <div class="gutslider-prev-icon"> -->