Code Duplication    Length = 3-4 lines in 3 locations

includes/api/class-wc-rest-products-controller.php 1 location

@@ 879-881 (lines=3) @@
876
		add_post_meta( $product->id, 'total_sales', '0', true );
877
878
		// Virtual.
879
		if ( isset( $request['virtual'] ) ) {
880
			update_post_meta( $product->id, '_virtual', true === $request['virtual'] ? 'yes' : 'no' );
881
		}
882
883
		// Tax status.
884
		if ( isset( $request['tax_status'] ) ) {

includes/cli/class-wc-cli-product.php 2 locations

@@ 1090-1092 (lines=3) @@
1087
		}
1088
1089
		// Virtual
1090
		if ( isset( $data['virtual'] ) ) {
1091
			update_post_meta( $product_id, '_virtual', ( $this->is_true( $data['virtual'] ) ) ? 'yes' : 'no' );
1092
		}
1093
1094
		// Tax status
1095
		if ( isset( $data['tax_status'] ) ) {
@@ 1611-1614 (lines=4) @@
1608
			}
1609
1610
			// Virtual variation
1611
			if ( isset( $variation['virtual'] ) ) {
1612
				$is_virtual = ( $this->is_true( $variation['virtual'] ) ) ? 'yes' : 'no';
1613
				update_post_meta( $variation_id, '_virtual', $is_virtual );
1614
			}
1615
1616
			// Downloadable variation
1617
			if ( isset( $variation['downloadable'] ) ) {