@@ -694,8 +694,8 @@ discard block |
||
694 | 694 | 'low_in_stock', |
695 | 695 | ); |
696 | 696 | foreach ( $custom_keys as $key ) { |
697 | - if ( ! empty( $request[ $key ] ) ) { |
|
698 | - $args[ $key ] = $request[ $key ]; |
|
697 | + if ( ! empty( $request[$key] ) ) { |
|
698 | + $args[$key] = $request[$key]; |
|
699 | 699 | } |
700 | 700 | } |
701 | 701 | |
@@ -712,11 +712,11 @@ discard block |
||
712 | 712 | |
713 | 713 | // Set tax_query for each passed arg. |
714 | 714 | foreach ( $taxonomies as $taxonomy => $key ) { |
715 | - if ( ! empty( $request[ $key ] ) ) { |
|
715 | + if ( ! empty( $request[$key] ) ) { |
|
716 | 716 | $tax_query[] = array( |
717 | 717 | 'taxonomy' => $taxonomy, |
718 | 718 | 'field' => 'term_id', |
719 | - 'terms' => $request[ $key ], |
|
719 | + 'terms' => $request[$key], |
|
720 | 720 | ); |
721 | 721 | } |
722 | 722 | } |
@@ -779,7 +779,7 @@ discard block |
||
779 | 779 | // Use 0 when there's no on sale products to avoid return all products. |
780 | 780 | $on_sale_ids = empty( $on_sale_ids ) ? array( 0 ) : $on_sale_ids; |
781 | 781 | |
782 | - $args[ $on_sale_key ] += $on_sale_ids; |
|
782 | + $args[$on_sale_key] += $on_sale_ids; |
|
783 | 783 | } |
784 | 784 | |
785 | 785 | // Force the post_type argument, since it's not a user input variable. |
@@ -923,10 +923,10 @@ discard block |
||
923 | 923 | $attribute = false; |
924 | 924 | |
925 | 925 | // pa_ attributes. |
926 | - if ( isset( $attributes[ wc_attribute_taxonomy_name( $slug ) ] ) ) { |
|
927 | - $attribute = $attributes[ wc_attribute_taxonomy_name( $slug ) ]; |
|
928 | - } elseif ( isset( $attributes[ $slug ] ) ) { |
|
929 | - $attribute = $attributes[ $slug ]; |
|
926 | + if ( isset( $attributes[wc_attribute_taxonomy_name( $slug )] ) ) { |
|
927 | + $attribute = $attributes[wc_attribute_taxonomy_name( $slug )]; |
|
928 | + } elseif ( isset( $attributes[$slug] ) ) { |
|
929 | + $attribute = $attributes[$slug]; |
|
930 | 930 | } |
931 | 931 | |
932 | 932 | if ( ! $attribute ) { |
@@ -1145,16 +1145,16 @@ discard block |
||
1145 | 1145 | protected function prepare_links( $object, $request ) { |
1146 | 1146 | $links = array( |
1147 | 1147 | 'self' => array( |
1148 | - 'href' => rest_url( sprintf( '/%s/%s/%d', $this->namespace, $this->rest_base, $object->get_id() ) ), // @codingStandardsIgnoreLine. |
|
1148 | + 'href' => rest_url( sprintf( '/%s/%s/%d', $this->namespace, $this->rest_base, $object->get_id() ) ), // @codingStandardsIgnoreLine. |
|
1149 | 1149 | ), |
1150 | 1150 | 'collection' => array( |
1151 | - 'href' => rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ), // @codingStandardsIgnoreLine. |
|
1151 | + 'href' => rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ), // @codingStandardsIgnoreLine. |
|
1152 | 1152 | ), |
1153 | 1153 | ); |
1154 | 1154 | |
1155 | 1155 | if ( $object->get_parent_id() ) { |
1156 | 1156 | $links['up'] = array( |
1157 | - 'href' => rest_url( sprintf( '/%s/products/%d', $this->namespace, $object->get_parent_id() ) ), // @codingStandardsIgnoreLine. |
|
1157 | + 'href' => rest_url( sprintf( '/%s/products/%d', $this->namespace, $object->get_parent_id() ) ), // @codingStandardsIgnoreLine. |
|
1158 | 1158 | ); |
1159 | 1159 | } |
1160 | 1160 | |
@@ -1358,8 +1358,8 @@ discard block |
||
1358 | 1358 | continue; |
1359 | 1359 | } |
1360 | 1360 | |
1361 | - if ( isset( $attributes[ $attribute_name ] ) ) { |
|
1362 | - $_attribute = $attributes[ $attribute_name ]; |
|
1361 | + if ( isset( $attributes[$attribute_name] ) ) { |
|
1362 | + $_attribute = $attributes[$attribute_name]; |
|
1363 | 1363 | |
1364 | 1364 | if ( $_attribute['is_variation'] ) { |
1365 | 1365 | $value = isset( $attribute['option'] ) ? wc_clean( stripslashes( $attribute['option'] ) ) : ''; |
@@ -1376,7 +1376,7 @@ discard block |
||
1376 | 1376 | } |
1377 | 1377 | |
1378 | 1378 | if ( $value ) { |
1379 | - $default_attributes[ $attribute_name ] = $value; |
|
1379 | + $default_attributes[$attribute_name] = $value; |
|
1380 | 1380 | } |
1381 | 1381 | } |
1382 | 1382 | } |