Skip to content

Commit

Permalink
fix(donate): override defaults with manual config (#1313)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkoo authored Nov 18, 2022
1 parent 2ab8776 commit 637284f
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,13 @@ public static function get_configuration( $attributes ) {
$configuration['amounts'] = $attributes['amounts'];
}

if ( isset( $attributes['disabledFrequencies'] ) ) {
foreach ( $attributes['disabledFrequencies'] as $frequency_slug => $is_disabled ) {
if ( $is_disabled ) {
$configuration['disabledFrequencies'][ $frequency_slug ] = true;
}
}
}

if ( isset( $attributes['minimumDonation'] ) ) {
$configuration['minimumDonation'] = $attributes['minimumDonation'];
}

// Override defaults with manual config.
$configuration['defaultFrequency'] = $attributes['defaultFrequency'];
$configuration['disabledFrequencies'] = $attributes['disabledFrequencies'];
}

// Ensure default frequency is valid (not disabled).
Expand Down

0 comments on commit 637284f

Please sign in to comment.