PluginProbe
Post Grid Gutenberg Blocks – PostX / 5.1.1
Post Grid Gutenberg Blocks – PostX v5.1.1
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_2.php +15 -8 5.0.18 → 5.1.1 View file →
@@ -18,8 +18,9 @@
18 18 // --------------------------
19 19 // Layout
20 20 // --------------------------
21 21 'layout' => 'layout1',
22 + 'infiniteScroll' => false,
22 23
23 24 /*
24 25 ============================
25 26 General Setting
@@ -239,9 +240,9 @@
239 240 }
240 241
241 242 public function content( $attr, $noAjax ) {
242 243 $attr = wp_parse_args( $attr, $this->get_attributes() );
243 - global $unique_ID;
244 + global $ultp_unique_ID;
244 245
245 246 if ( ! $noAjax ) {
246 247 $paged = is_front_page() ? get_query_var( 'page' ) : get_query_var( 'paged' );
247 248 $attr['paged'] = $paged ? $paged : 1;
@@ -246,9 +247,9 @@
246 247 $paged = is_front_page() ? get_query_var( 'page' ) : get_query_var( 'paged' );
247 248 $attr['paged'] = $paged ? $paged : 1;
248 249 }
249 250 if ( $attr['queryUnique'] && isset( $attr['savedQueryUnique'] ) ) {
250 - $unique_ID = $attr['savedQueryUnique'];
251 + $ultp_unique_ID = $attr['savedQueryUnique'];
251 252 }
252 253
253 254 $block_name = 'post-list-2';
254 255 $vid_icon_redirect = true; // Its used for video icon do not remove it
@@ -260,9 +261,9 @@
260 261 $dummy_url = ULTP_URL . 'assets/img/ultp-fallback-img.png';
261 262
262 263 // Loadmore and Unique content
263 264 if ( $attr['queryUnique'] && isset( $attr['loadMoreQueryUnique'] ) && $attr['paginationShow'] && ( $attr['paginationType'] == 'loadMore' ) ) {
264 - $unique_ID = $attr['loadMoreQueryUnique'];
265 + $ultp_unique_ID = $attr['loadMoreQueryUnique'];
265 266 $current_unique_posts = $attr['ultp_current_unique_posts'];
266 267 }
267 268
268 269 $attr['className'] = isset( $attr['className'] ) && $attr['className'] ? preg_replace( '/[^A-Za-z0-9_ -]/', '', $attr['className'] ) : '';
@@ -275,8 +276,14 @@
275 276 $attr['imgOverlayType'] = sanitize_html_class( $attr['imgOverlayType'] );
276 277 $attr['popupAutoPlay'] = $attr['popupAutoPlay'] == true;
277 278 $attr['readMoreText'] = wp_kses( $attr['readMoreText'], ultimate_post()->ultp_allowed_html_tags() );
278 279 $attr['varticalAlign'] = sanitize_html_class( $attr['varticalAlign'] );
280 + $iscroll = '';
281 + $wrap_data = '';
282 + if ( $attr['infiniteScroll'] ) {
283 + $iscroll = 'ultp-iscroll-active';
284 + include ULTP_PATH . 'blocks/template/infinite_scroll_data.php';
285 + }
279 286
280 287 if ( $recent_posts->have_posts() ) {
281 288
282 289 // Pagination Block Html
@@ -281,10 +288,10 @@
281 288
282 289 // Pagination Block Html
283 290 include ULTP_PATH . 'blocks/template/pagination_block.php';
284 291
285 - $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'] : '' ) . '">';
286 - $wraper_before .= '<div class="ultp-block-wrapper">';
292 + $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 . '">';
293 + $wraper_before .= '<div class="ultp-block-wrapper" ' . $wrap_data . '>';
287 294
288 295 // Loading
289 296 $wraper_before .= ultimate_post()->postx_loading();
290 297
@@ -329,9 +336,9 @@
329 336
330 337 include ULTP_PATH . 'blocks/template/category.php';
331 338
332 339 if ( $attr['queryUnique'] ) {
333 - $unique_ID[ $attr['queryUnique'] ][] = $post_id;
340 + $ultp_unique_ID[ $attr['queryUnique'] ][] = $post_id;
334 341 $current_unique_posts[] = $post_id;
335 342 }
336 343
337 344 $post_loop .= '<' . $attr['contentTag'] . ' class="ultp-block-item ultp-block-media post-id-' . $post_id . '">';
@@ -452,9 +459,9 @@
452 459 $post_loop .= '</' . $attr['contentTag'] . '>';
453 460 ++$idx;
454 461 endwhile;
455 462 if ( $attr['queryUnique'] ) {
456 - $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>';
463 + $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>';
457 464 }
458 465
459 466 // if ( ( $attr['paginationShow'] || $attr['advPaginationEnable'] ) && ($attr['paginationType'] == 'loadMore')) {
460 467 // $wraper_after .= '<span class="ultp-loadmore-insert-before"></span>';
@@ -480,9 +487,9 @@
480 487 $wraper_after .= '</div>';
481 488 $wraper_after .= $pagi_block_html;
482 489 $wraper_after .= '</div>';
483 490
484 - wp_reset_query();
491 + wp_reset_postdata();
485 492 } else {
486 493 $wraper_before .= ultimate_post()->get_no_result_found_html( $attr['notFoundMessage'] );
487 494 }
488 495