Code Duplication    Length = 6-7 lines in 2 locations

includes/price-functions.php 1 location

@@ 96-102 (lines=7) @@
93
	$default_price = '1.00';
94
	$prices        = apply_filters( 'give_form_variable_prices', give_get_variable_prices( $form_id ), $form_id );
95
96
	foreach ( $prices as $price ) {
97
98
		if ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) {
99
			$default_price = $price['_give_amount'];
100
		}
101
102
	}
103
104
	return $default_price;
105

includes/forms/functions.php 1 location

@@ 791-796 (lines=6) @@
788
		if ( false !== $price_id ) {
789
790
			// loop through multi-prices to see which is default
791
			foreach ( $prices as $price ) {
792
				// this is the default price
793
				if ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) {
794
					$price = (float) $price['_give_amount'];
795
				};
796
			}
797
		} else {
798
799
			$price = give_get_lowest_price_option( $form_id );