You appear to be a bot. Output may be restricted
Description
Sanitize the variable prices
Ensures prices are correctly mapped to an array starting with an index of 0
Usage
$array = EDD_Register_Meta::sanitize_variable_prices( $prices );
Parameters
- $prices
- ( array ) optional – Variable prices
Returns
array $prices Array of the remapped variable prices
Source
File name: easy-digital-downloads/includes/class-edd-register-meta.php
Lines:
1 to 26 of 26
public function sanitize_variable_prices( $prices = array() ) { $prices = $this->remove_blank_rows( $prices ); if ( ! is_array( $prices ) ) { return array(); } foreach ( $prices as $id => $price ) { if ( empty( $price['amount'] ) && empty( $price['name'] ) ) { unset( $prices[ $id ] ); continue; } elseif ( empty( $price['amount'] ) ) { $price['amount'] = 0; } $prices[ $id ]['amount'] = $this->sanitize_price( $price['amount'] ); } return $prices; }