Skip to content

Commit

Permalink
fix buggy option setting code
Browse files Browse the repository at this point in the history
  • Loading branch information
liedekef committed Jul 17, 2024
1 parent 33ce873 commit 5f9c500
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions eme-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -878,10 +878,8 @@ function eme_update_options( $db_version ) {

function eme_add_option( $key, $value, $reset ) {
$existing_value = get_option( $key, 'non_existing' );
if ( ( !is_array($existing_value) && $existing_value == 'non_existing' ) || $reset ) {
if ( $existing_value == 'non_existing' || $reset ) {
update_option( $key, $value );
} elseif (is_array($existing_value)) {
update_option( $key, array_merge($value,$existing_value));
}
}

Expand Down

0 comments on commit 5f9c500

Please sign in to comment.