You appear to be a bot. Output may be restricted
Description
Don't save blank rows.
When saving, check the price and file table for blank rows. If the name of the price or file is empty, that row should not be saved.
Usage
$array = EDD_Register_Meta::remove_blank_rows( $new );
Parameters
- $new
- ( array ) required – Array of all the meta values
Returns
array $new New meta value with empty keys removed
Source
File name: easy-digital-downloads/includes/class-edd-register-meta.php
Lines:
1 to 12 of 12
private function remove_blank_rows( $new ) { if ( is_array( $new ) ) { foreach ( $new as $key => $value ) { if ( empty( $value['name'] ) && empty( $value['amount'] ) && empty( $value['file'] ) ) { unset( $new[ $key ] ); } } } return $new; }