PluginProbe
Post Grid Gutenberg Blocks – PostX / 5.1.0
Post Grid Gutenberg Blocks – PostX v5.1.0
5.1.1 5.1.0 5.0.41 5.0.39 5.0.38 5.0.37 5.0.36 5.0.35 5.0.34 5.0.33 5.0.32 5.0.31 5.0.30 5.0.29 5.0.28 5.0.27 5.0.26 5.0.25 5.0.23 5.0.24 5.0.22 5.0.21 5.0.20 5.0.19 5.0.18 All 240 releases
← All changes | blocks/Post_List_3.php +16 -8 5.0.28 → 5.1.0 View file →
@@ -17,8 +17,9 @@
17 17 // --------------------------
18 18 // Layout
19 19 // --------------------------
20 20 'layout' => 'layout1',
21 + 'infiniteScroll' => false,
21 22
22 23 // --------------------------
23 24 // Query Setting
24 25 // --------------------------
@@ -218,9 +219,9 @@
218 219 }
219 220
220 221 public function content( $attr, $noAjax ) {
221 222 $attr = wp_parse_args( $attr, $this->get_attributes() );
222 - global $unique_ID;
223 + global $ultp_unique_ID;
223 224
224 225 if ( ! $noAjax ) {
225 226 $paged = is_front_page() ? get_query_var( 'page' ) : get_query_var( 'paged' );
226 227 $attr['paged'] = $paged ? $paged : 1;
@@ -225,9 +226,9 @@
225 226 $paged = is_front_page() ? get_query_var( 'page' ) : get_query_var( 'paged' );
226 227 $attr['paged'] = $paged ? $paged : 1;
227 228 }
228 229 if ( $attr['queryUnique'] && isset( $attr['savedQueryUnique'] ) ) {
229 - $unique_ID = $attr['savedQueryUnique'];
230 + $ultp_unique_ID = $attr['savedQueryUnique'];
230 231 }
231 232
232 233 $block_name = 'post-list-3';
233 234 $wraper_before = $wraper_after = $post_loop = '';
@@ -238,9 +239,9 @@
238 239 $dummy_url = ULTP_URL . 'assets/img/ultp-fallback-img.png';
239 240
240 241 // Loadmore and Unique content
241 242 if ( $attr['queryUnique'] && isset( $attr['loadMoreQueryUnique'] ) && $attr['paginationShow'] && ( $attr['paginationType'] == 'loadMore' ) ) {
242 - $unique_ID = $attr['loadMoreQueryUnique'];
243 + $ultp_unique_ID = $attr['loadMoreQueryUnique'];
243 244 $current_unique_posts = $attr['ultp_current_unique_posts'];
244 245 }
245 246
246 247 $attr['className'] = isset( $attr['className'] ) && $attr['className'] ? preg_replace( '/[^A-Za-z0-9_ -]/', '', $attr['className'] ) : '';
@@ -254,15 +255,22 @@
254 255 $attr['popupAutoPlay'] = $attr['popupAutoPlay'] == true;
255 256 $attr['readMoreText'] = wp_kses( $attr['readMoreText'], ultimate_post()->ultp_allowed_html_tags() );
256 257 $attr['varticalAlign'] = sanitize_html_class( $attr['varticalAlign'] );
257 258
259 + $iscroll = '';
260 + $wrap_data = '';
261 + if ( $attr['infiniteScroll'] ) {
262 + $iscroll = 'ultp-iscroll-active';
263 + include ULTP_PATH . 'blocks/template/infinite_scroll_data.php';
264 + }
265 +
258 266 if ( $recent_posts->have_posts() ) {
259 267
260 268 // Pagination Block Html
261 269 include ULTP_PATH . 'blocks/template/pagination_block.php';
262 270
263 - $wraper_before .= '<div ' . ( $attr['advanceId'] ? 'id="' . $attr['advanceId'] . '" ' : '' ) . ' class="ultp-post-grid-block wp-block-ultimate-post-' . $block_name . ' ultp-block-' . $attr['blockId'] . '' . ( $attr['align'] ? ' align' . $attr['align'] : '' ) . '' . ( $attr['className'] ? ' ' . $attr['className'] : '' ) . '">';
264 - $wraper_before .= '<div class="ultp-block-wrapper">';
271 + $wraper_before .= '<div ' . ( $attr['advanceId'] ? 'id="' . $attr['advanceId'] . '" ' : '' ) . ' class="ultp-post-grid-block wp-block-ultimate-post-' . $block_name . ' ultp-block-' . $attr['blockId'] . '' . ( $attr['align'] ? ' align' . $attr['align'] : '' ) . '' . ( $attr['className'] ? ' ' . $attr['className'] : '' ) . ' ' . $iscroll . '">';
272 + $wraper_before .= '<div class="ultp-block-wrapper" ' . $wrap_data . '>';
265 273
266 274 // Loading
267 275 $wraper_before .= ultimate_post()->postx_loading();
268 276
@@ -307,9 +315,9 @@
307 315
308 316 include ULTP_PATH . 'blocks/template/category.php';
309 317
310 318 if ( $attr['queryUnique'] ) {
311 - $unique_ID[ $attr['queryUnique'] ][] = $post_id;
319 + $ultp_unique_ID[ $attr['queryUnique'] ][] = $post_id;
312 320 $current_unique_posts[] = $post_id;
313 321 }
314 322
315 323 $post_loop .= '<' . $attr['contentTag'] . ' class="ultp-block-item ultp-block-media post-id-' . $post_id . '">';
@@ -402,9 +410,9 @@
402 410 $post_loop .= '</' . $attr['contentTag'] . '>';
403 411 ++$idx;
404 412 endwhile;
405 413 if ( $attr['queryUnique'] ) {
406 - $post_loop .= "<span style='display: none;' class='ultp-current-unique-posts' data-ultp-unique-ids= " . wp_json_encode( $unique_ID ) . ' data-current-unique-posts= ' . wp_json_encode( $current_unique_posts ) . '> </span>';
414 + $post_loop .= "<span style='display: none;' class='ultp-current-unique-posts' data-ultp-unique-ids= " . wp_json_encode( $ultp_unique_ID ) . ' data-current-unique-posts= ' . wp_json_encode( $current_unique_posts ) . '> </span>';
407 415 }
408 416 // if ( ($attr['paginationShow'] || $attr['advPaginationEnable'] ) && ($attr['paginationType'] == 'loadMore')) {
409 417 // $wraper_after .= '<span class="ultp-loadmore-insert-before"></span>';
410 418 // }
@@ -429,9 +437,9 @@
429 437 $wraper_after .= '</div>';
430 438 $wraper_after .= $pagi_block_html;
431 439 $wraper_after .= '</div>';
432 440
433 - wp_reset_query();
441 + wp_reset_postdata();
434 442 } else {
435 443 $wraper_before .= ultimate_post()->get_no_result_found_html( $attr['notFoundMessage'] );
436 444 }
437 445