Fix is_mandatory checkbox not saving when unchecked
This commit is contained in:
@@ -259,7 +259,7 @@ class Validator {
|
||||
$unit_amount = isset( $data['unit_amount'] ) ? str_replace( ',', '.', wp_unslash( $data['unit_amount'] ) ) : '';
|
||||
$entry_year = $this->sanitize_cost_year( $data );
|
||||
$distribution_type = sanitize_key( wp_unslash( isset( $data['distribution_type'] ) ? $data['distribution_type'] : 'parcel' ) );
|
||||
$is_mandatory = isset( $data['is_mandatory'] ) ? (bool) $data['is_mandatory'] : true;
|
||||
$is_mandatory = isset( $data['is_mandatory'] ) && '1' === (string) wp_unslash( $data['is_mandatory'] );
|
||||
|
||||
return array(
|
||||
'entry_year' => $entry_year,
|
||||
|
||||
Reference in New Issue
Block a user