| @@ -125,14 +125,8 @@ | ||
| 125 | 125 | if ( ! empty( $pagination_attributes ) ) { |
| 126 | 126 | $container_attributes['data-rtsb-ajax'] = $pagination_attributes; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | - // Opt-out of the scroll-to-top behaviour on Ajax filter/pagination when | |
| 130 | - // the "Enable Scroll To Top?" switch is turned off. | |
| 131 | - if ( isset( $settings['enable_ajax_scroll'] ) && empty( $settings['enable_ajax_scroll'] ) ) { | |
| 132 | - $container_attributes['data-rtsb-disable-scroll'] = '1'; | |
| 133 | - } | |
| 134 | - | |
| 135 | 129 | // Adding render attributes. |
| 136 | 130 | $this->add_attribute( 'rtsb_container_attr_' . $rand, $container_attributes ); |
| 137 | 131 | |
| 138 | 132 | // Start rendering. |
| @@ -513,9 +507,9 @@ | ||
| 513 | 507 | |
| 514 | 508 | $restore_query = true; |
| 515 | 509 | } |
| 516 | 510 | |
| 517 | - if ( rtsb()->has_pro() && ( Fns::product_has_applied_filters( 'shop' ) || Fns::product_has_applied_filters( 'archive' ) || 'rtsb_builder' === get_post_type( get_the_ID() ) ) ) { | |
| 511 | + if ( Fns::product_has_applied_filters( 'shop' ) || Fns::product_has_applied_filters( 'archive' ) || 'rtsb_builder' === get_post_type( get_the_ID() ) ) { | |
| 518 | 512 | $rtsb_active_filters_html = Fns::get_active_filters_html(); |
| 519 | 513 | $rtsb_wrapper_style = '' !== $rtsb_active_filters_html ? ' style="' . esc_attr( 'display:block;' ) . '"' : ''; |
| 520 | 514 | echo '<div class="rtsb-active-filters-wrapper"' . $rtsb_wrapper_style . '>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Style value is escaped above. |
| 521 | 515 | Fns::print_html( $rtsb_active_filters_html, true ); |
| @@ -538,11 +532,11 @@ | ||
| 538 | 532 | if ( $wp_query->max_num_pages > 1 ) { |
| 539 | 533 | $posts_loading_type = ! empty( $metas['posts_loading_type'] ) ? $metas['posts_loading_type'] : 'pagination'; |
| 540 | 534 | |
| 541 | 535 | if ( 'pagination_ajax' === $posts_loading_type ) { |
| 542 | - $this->html .= Fns::custom_pagination( $wp_query->max_num_pages, $posts_per_page, true, $metas['visible_range'] ?? null ); | |
| 536 | + $this->html .= Fns::custom_pagination( $wp_query->max_num_pages, $posts_per_page, true ); | |
| 543 | 537 | } elseif ( 'pagination' === $posts_loading_type ) { |
| 544 | - $this->html .= Fns::custom_pagination( $wp_query->max_num_pages, $posts_per_page, false, $metas['visible_range'] ?? null ); | |
| 538 | + $this->html .= Fns::custom_pagination( $wp_query->max_num_pages, $posts_per_page, false ); | |
| 545 | 539 | } elseif ( 'load_on_scroll' === $posts_loading_type ) { |
| 546 | 540 | $this->html .= "<div class='rtsb-infinite-scroll' data-trigger='1' data-paged='2' data-max-page='{$wp_query->max_num_pages}'> |
| 547 | 541 | <div class='rtsb-infinite-action'> |
| 548 | 542 | <div class='rtsb-loadmore-loading rtsb-ball-clip-rotate'><div></div></div> |
| @@ -1090,26 +1084,8 @@ | ||
| 1090 | 1084 | add_filter( 'rtsb/module/wishlist/button_params', [ $this, 'button_classes' ] ); |
| 1091 | 1085 | add_filter( 'rtsb/module/wishlist/icon_html', [ $this, 'wishlist_icon' ] ); |
| 1092 | 1086 | } |
| 1093 | 1087 | |
| 1094 | - // Eager-load the above-the-fold product images so the LCP candidate is | |
| 1095 | - // fetched immediately instead of being lazy-loaded after render-blocking | |
| 1096 | - // CSS and layout. Defaults to the mobile viewport row count (Lighthouse | |
| 1097 | - // scores mobile); eagering below-the-fold images would only steal | |
| 1098 | - // bandwidth from the visible ones. Filterable per layout. | |
| 1099 | - $eager_count = (int) apply_filters( 'rtsb/loop/eager_image_count', 6, $meta ); | |
| 1100 | - | |
| 1101 | - // The mobile LCP is often NOT the first card but the top-right one in a | |
| 1102 | - // 2-column grid, so the first *row* of images gets fetchpriority=high to | |
| 1103 | - // promote the real LCP candidate ahead of render-blocking CSS. Kept small | |
| 1104 | - // (default 2 = one mobile row) to avoid competing high-priority requests. | |
| 1105 | - $high_count = (int) apply_filters( 'rtsb/loop/fetchpriority_high_count', 2, $meta ); | |
| 1106 | - $img_priority = false; | |
| 1107 | - | |
| 1108 | - if ( $i <= $eager_count ) { | |
| 1109 | - $img_priority = $i <= $high_count ? 'high' : 'eager'; | |
| 1110 | - } | |
| 1111 | - | |
| 1112 | 1088 | $arg['img_html'] = $meta['f_img'] ? Fns::get_product_image_html( |
| 1113 | 1089 | 'product', |
| 1114 | 1090 | $post_id, |
| 1115 | 1091 | $meta['f_img_size'], |
| @@ -1114,13 +1090,9 @@ | ||
| 1114 | 1090 | $post_id, |
| 1115 | 1091 | $meta['f_img_size'], |
| 1116 | 1092 | $meta['default_img_id'], |
| 1117 | 1093 | $meta['custom_img_size'], |
| 1118 | - $lazy_load, | |
| 1119 | - false, | |
| 1120 | - false, | |
| 1121 | - 0, | |
| 1122 | - $img_priority | |
| 1094 | + $lazy_load | |
| 1123 | 1095 | ) : null; |
| 1124 | 1096 | |
| 1125 | 1097 | if ( ! ( function_exists( 'rtwpvsp' ) && $product->is_type( 'variable' ) && $product->get_attributes() ) ) { |
| 1126 | 1098 | $gallery_ids = $product->get_gallery_image_ids(); |
| @@ -1353,11 +1325,9 @@ | ||
| 1353 | 1325 | if ( 'pagination' === $meta['posts_loading_type'] ) { |
| 1354 | 1326 | if ( $is_grid ) { |
| 1355 | 1327 | $html_utility .= Fns::custom_pagination( |
| 1356 | 1328 | $total_page, |
| 1357 | - 'wc' === $query_type ? $per_page : $posts_per_page, | |
| 1358 | - false, | |
| 1359 | - $meta['visible_range'] ?? null | |
| 1329 | + 'wc' === $query_type ? $per_page : $posts_per_page | |
| 1360 | 1330 | ); |
| 1361 | 1331 | } |
| 1362 | 1332 | } elseif ( 'pagination_ajax' === $meta['posts_loading_type'] && ! rtsb()->has_pro() ) { |
| 1363 | 1333 | // Free version fallback: render non-AJAX number pagination so filter |
| @@ -1364,11 +1334,9 @@ | ||
| 1364 | 1334 | // params in the URL are preserved via get_pagenum_link(). |
| 1365 | 1335 | if ( $is_grid ) { |
| 1366 | 1336 | $html_utility .= Fns::custom_pagination( |
| 1367 | 1337 | $total_page, |
| 1368 | - 'wc' === $query_type ? $per_page : $posts_per_page, | |
| 1369 | - false, | |
| 1370 | - $meta['visible_range'] ?? null | |
| 1338 | + 'wc' === $query_type ? $per_page : $posts_per_page | |
| 1371 | 1339 | ); |
| 1372 | 1340 | } |
| 1373 | 1341 | } else { |
| 1374 | 1342 | ob_start(); |