| @@ -228,9 +228,9 @@ | ||
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | public function content( $attr, $noAjax ) { |
| 231 | 231 | $attr = wp_parse_args( $attr, $this->get_attributes() ); |
| 232 | - global $unique_ID; | |
| 232 | + global $ultp_unique_ID; | |
| 233 | 233 | |
| 234 | 234 | if ( ! $noAjax ) { |
| 235 | 235 | $paged = is_front_page() ? get_query_var( 'page' ) : get_query_var( 'paged' ); |
| 236 | 236 | $attr['paged'] = $paged ? $paged : 1; |
| @@ -235,9 +235,9 @@ | ||
| 235 | 235 | $paged = is_front_page() ? get_query_var( 'page' ) : get_query_var( 'paged' ); |
| 236 | 236 | $attr['paged'] = $paged ? $paged : 1; |
| 237 | 237 | } |
| 238 | 238 | if ( $attr['queryUnique'] && isset( $attr['savedQueryUnique'] ) ) { |
| 239 | - $unique_ID = $attr['savedQueryUnique']; | |
| 239 | + $ultp_unique_ID = $attr['savedQueryUnique']; | |
| 240 | 240 | } |
| 241 | 241 | $block_name = 'post-grid-1'; |
| 242 | 242 | $wraper_before = $wraper_after = $post_loop = ''; |
| 243 | 243 | $attr['queryNumber'] = ultimate_post()->get_post_number( 4, $attr['queryNumber'], $attr['queryNumPosts'] ); |
| @@ -256,9 +256,9 @@ | ||
| 256 | 256 | $dummy_url = ULTP_URL . 'assets/img/ultp-fallback-img.png'; |
| 257 | 257 | |
| 258 | 258 | // Loadmore and Unique content |
| 259 | 259 | if ( $attr['queryUnique'] && isset( $attr['loadMoreQueryUnique'] ) && $attr['paginationShow'] && ( $attr['paginationType'] == 'loadMore' ) ) { |
| 260 | - $unique_ID = $attr['loadMoreQueryUnique']; | |
| 260 | + $ultp_unique_ID = $attr['loadMoreQueryUnique']; | |
| 261 | 261 | $current_unique_posts = $attr['ultp_current_unique_posts']; |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | $attr['className'] = isset( $attr['className'] ) && $attr['className'] ? preg_replace( '/[^A-Za-z0-9_ -]/', '', $attr['className'] ) : ''; |
| @@ -337,9 +337,9 @@ | ||
| 337 | 337 | |
| 338 | 338 | include ULTP_PATH . 'blocks/template/category.php'; |
| 339 | 339 | |
| 340 | 340 | if ( $attr['queryUnique'] ) { |
| 341 | - $unique_ID[ $attr['queryUnique'] ][] = $post_id; | |
| 341 | + $ultp_unique_ID[ $attr['queryUnique'] ][] = $post_id; | |
| 342 | 342 | $current_unique_posts[] = $post_id; |
| 343 | 343 | } |
| 344 | 344 | $divStyle = ''; |
| 345 | 345 | if ( $post_thumb_id && $attr['showImage'] ) { |
| @@ -443,9 +443,9 @@ | ||
| 443 | 443 | $post_loop .= '</' . $attr['contentTag'] . '>'; |
| 444 | 444 | ++$idx; |
| 445 | 445 | endwhile; |
| 446 | 446 | if ( $attr['queryUnique'] ) { |
| 447 | - $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>'; | |
| 447 | + $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>'; | |
| 448 | 448 | } |
| 449 | 449 | // if ( ($attr['paginationShow'] || $attr['advPaginationEnable']) && ($attr['paginationType'] == 'loadMore')) { |
| 450 | 450 | // $wraper_after .= '<span class="ultp-loadmore-insert-before"></span>'; |
| 451 | 451 | // } |
| @@ -469,9 +469,9 @@ | ||
| 469 | 469 | $wraper_after .= '</div>'; |
| 470 | 470 | $wraper_after .= $pagi_block_html; |
| 471 | 471 | $wraper_after .= '</div>'; |
| 472 | 472 | |
| 473 | - wp_reset_query(); | |
| 473 | + wp_reset_postdata(); | |
| 474 | 474 | |
| 475 | 475 | } else { |
| 476 | 476 | $wraper_before .= ultimate_post()->get_no_result_found_html( $attr['notFoundMessage'] ); |
| 477 | 477 | } |