| @@ -93,9 +93,9 @@ | ||
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | if ( $post_not_in ) { |
| 96 | 96 | $post_not_in = explode( ',', $post_not_in ); |
| 97 | - $this->args['exclude'] = $post_not_in; // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude | |
| 97 | + $this->args['exclude'] = $post_not_in; | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | if ( $author_in ) { |
| 101 | 101 | $this->args['author'] = $author_in; |
| @@ -134,9 +134,9 @@ | ||
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | if ( $cats_not_in ) { |
| 137 | 137 | $cats_not_in = array_filter( explode( ',', $cats_not_in ) ); |
| 138 | - $this->args['exclude'] = $cats_not_in; // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude | |
| 138 | + $this->args['exclude'] = $cats_not_in; | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | $this->args['number'] = $limit; |
| 142 | 142 | $this->args['hide_empty'] = $this->meta['show_empty'] ? 0 : 1; |
| @@ -188,13 +188,8 @@ | ||
| 188 | 188 | |
| 189 | 189 | if ( 'menu_order' === $order_by ) { |
| 190 | 190 | $this->args['orderby'] = 'menu_order title'; |
| 191 | 191 | } |
| 192 | - | |
| 193 | - if ( 'price' === $order_by ) { | |
| 194 | - $this->args['orderby'] = 'meta_value_num'; | |
| 195 | - $this->args['meta_key'] = '_price'; // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key | |
| 196 | - } | |
| 197 | 192 | } |
| 198 | 193 | |
| 199 | 194 | return $this; |
| 200 | 195 | } |
| @@ -245,17 +240,13 @@ | ||
| 245 | 240 | |
| 246 | 241 | $this->args['paginate'] = true; |
| 247 | 242 | $this->args['limit'] = $posts_per_page; |
| 248 | 243 | |
| 249 | - // Prefer `paged` (archive pagination), fall back to `page` (paginated singular posts). | |
| 250 | - // Handles the case where the shop/archive is set as the front page. | |
| 251 | - $paged = get_query_var( 'paged' ); | |
| 252 | - if ( ! $paged ) { | |
| 253 | - $paged = get_query_var( 'page' ); | |
| 244 | + if ( is_front_page() ) { | |
| 245 | + $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1; | |
| 246 | + } else { | |
| 247 | + $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; | |
| 254 | 248 | } |
| 255 | - if ( ! $paged ) { | |
| 256 | - $paged = 1; | |
| 257 | - } | |
| 258 | 249 | |
| 259 | 250 | $offset = $posts_per_page * ( (int) $paged - 1 ); |
| 260 | 251 | $this->args['page'] = $paged; |
| 261 | 252 | |
| @@ -278,18 +269,13 @@ | ||
| 278 | 269 | * @return void |
| 279 | 270 | */ |
| 280 | 271 | private function tax_params(): void { |
| 281 | 272 | $categories = isset( $this->meta['categories'] ) ? array_filter( $this->meta['categories'] ) : []; |
| 282 | - $brands = isset( $this->meta['brands'] ) ? array_filter( $this->meta['brands'] ) : []; | |
| 283 | 273 | $tags = isset( $this->meta['tags'] ) ? array_filter( $this->meta['tags'] ) : []; |
| 284 | 274 | $attributes = isset( $this->meta['attributes'] ) ? array_filter( $this->meta['attributes'] ) : []; |
| 285 | 275 | |
| 286 | 276 | if ( ! empty( $categories ) ) { |
| 287 | 277 | $this->args['product_category_id'] = $categories; |
| 288 | - } | |
| 289 | - | |
| 290 | - if ( ! empty( $brands ) ) { | |
| 291 | - $this->args['product_brand_id'] = $brands; | |
| 292 | 278 | } |
| 293 | 279 | |
| 294 | 280 | if ( ! empty( $tags ) ) { |
| 295 | 281 | $this->args['product_tag_id'] = $tags; |