| @@ -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; | |
| 97 | + $this->args['exclude'] = $post_not_in; // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude | |
| 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; | |
| 138 | + $this->args['exclude'] = $cats_not_in; // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | $this->args['number'] = $limit; |
| 142 | 142 | $this->args['hide_empty'] = $this->meta['show_empty'] ? 0 : 1; |
| @@ -188,8 +188,13 @@ | ||
| 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 | + } | |
| 192 | 197 | } |
| 193 | 198 | |
| 194 | 199 | return $this; |
| 195 | 200 | } |
| @@ -269,13 +274,18 @@ | ||
| 269 | 274 | * @return void |
| 270 | 275 | */ |
| 271 | 276 | private function tax_params(): void { |
| 272 | 277 | $categories = isset( $this->meta['categories'] ) ? array_filter( $this->meta['categories'] ) : []; |
| 278 | + $brands = isset( $this->meta['brands'] ) ? array_filter( $this->meta['brands'] ) : []; | |
| 273 | 279 | $tags = isset( $this->meta['tags'] ) ? array_filter( $this->meta['tags'] ) : []; |
| 274 | 280 | $attributes = isset( $this->meta['attributes'] ) ? array_filter( $this->meta['attributes'] ) : []; |
| 275 | 281 | |
| 276 | 282 | if ( ! empty( $categories ) ) { |
| 277 | 283 | $this->args['product_category_id'] = $categories; |
| 284 | + } | |
| 285 | + | |
| 286 | + if ( ! empty( $brands ) ) { | |
| 287 | + $this->args['product_brand_id'] = $brands; | |
| 278 | 288 | } |
| 279 | 289 | |
| 280 | 290 | if ( ! empty( $tags ) ) { |
| 281 | 291 | $this->args['product_tag_id'] = $tags; |