@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | |
377 | 377 | // Price filter. |
378 | 378 | if ( ! empty( $request['min_price'] ) || ! empty( $request['max_price'] ) ) { |
379 | - $args['meta_query'] = $this->add_meta_query( $args, wc_get_min_max_price_meta_query( $request ) ); // WPCS: slow query ok. |
|
379 | + $args['meta_query'] = $this->add_meta_query( $args, wc_get_min_max_price_meta_query( $request ) ); // WPCS: slow query ok. |
|
380 | 380 | } |
381 | 381 | |
382 | 382 | // Filter product based on stock_status. |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | // Use 0 when there's no on sale products to avoid return all products. |
399 | 399 | $on_sale_ids = empty( $on_sale_ids ) ? array( 0 ) : $on_sale_ids; |
400 | 400 | |
401 | - $args[ $on_sale_key ] += $on_sale_ids; |
|
401 | + $args[$on_sale_key] += $on_sale_ids; |
|
402 | 402 | } |
403 | 403 | |
404 | 404 | // Force the post_type argument, since it's not a user input variable. |
@@ -578,14 +578,14 @@ discard block |
||
578 | 578 | continue; |
579 | 579 | } |
580 | 580 | |
581 | - if ( ! isset( $parent_attributes[ $attribute_name ] ) || ! $parent_attributes[ $attribute_name ]->get_variation() ) { |
|
581 | + if ( ! isset( $parent_attributes[$attribute_name] ) || ! $parent_attributes[$attribute_name]->get_variation() ) { |
|
582 | 582 | continue; |
583 | 583 | } |
584 | 584 | |
585 | - $attribute_key = sanitize_title( $parent_attributes[ $attribute_name ]->get_name() ); |
|
585 | + $attribute_key = sanitize_title( $parent_attributes[$attribute_name]->get_name() ); |
|
586 | 586 | $attribute_value = isset( $attribute['option'] ) ? wc_clean( stripslashes( $attribute['option'] ) ) : ''; |
587 | 587 | |
588 | - if ( $parent_attributes[ $attribute_name ]->is_taxonomy() ) { |
|
588 | + if ( $parent_attributes[$attribute_name]->is_taxonomy() ) { |
|
589 | 589 | // If dealing with a taxonomy, we need to get the slug from the name posted to the API. |
590 | 590 | $term = get_term_by( 'name', $attribute_value, $attribute_name ); |
591 | 591 | |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | } |
597 | 597 | } |
598 | 598 | |
599 | - $attributes[ $attribute_key ] = $attribute_value; |
|
599 | + $attributes[$attribute_key] = $attribute_value; |
|
600 | 600 | } |
601 | 601 | |
602 | 602 | $variation->set_attributes( $attributes ); |
@@ -758,9 +758,9 @@ discard block |
||
758 | 758 | $body_params = array(); |
759 | 759 | |
760 | 760 | foreach ( array( 'update', 'create', 'delete' ) as $batch_type ) { |
761 | - if ( ! empty( $items[ $batch_type ] ) ) { |
|
761 | + if ( ! empty( $items[$batch_type] ) ) { |
|
762 | 762 | $injected_items = array(); |
763 | - foreach ( $items[ $batch_type ] as $item ) { |
|
763 | + foreach ( $items[$batch_type] as $item ) { |
|
764 | 764 | $injected_items[] = is_array( $item ) ? array_merge( |
765 | 765 | array( |
766 | 766 | 'product_id' => $product_id, |
@@ -768,7 +768,7 @@ discard block |
||
768 | 768 | $item |
769 | 769 | ) : $item; |
770 | 770 | } |
771 | - $body_params[ $batch_type ] = $injected_items; |
|
771 | + $body_params[$batch_type] = $injected_items; |
|
772 | 772 | } |
773 | 773 | } |
774 | 774 |