Skip to content

Commit

Permalink
Change according to wordpress.org guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
ysalitrynskyi committed Apr 14, 2024
1 parent 6c9b4f2 commit 8b75662
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions functions/settings-management.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,15 @@ function ekvalues_key_value_setting() {
}

function ekvalues_options_validate($input) {
parse_str($input, $options);
$options = $options['ekvalues_options'] ?? [];
$new_input = array();

if (is_string($input)) {
parse_str($input, $parsed);
$options = $parsed['ekvalues_options'] ?? [];
} else {
$options = isset($input[0]['key']) ? $input : ($input['ekvalues_options'] ?? []);
}

foreach ($options as $pair) {
if (!empty($pair['key']) && isset($pair['visibility'])) {
$sanitized_key = sanitize_text_field($pair['key']);
Expand Down

0 comments on commit 8b75662

Please sign in to comment.