Skip to content

Commit

Permalink
Merge pull request #7 from RRZE-Webteam/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
rvdforst authored Aug 1, 2023
2 parents be3c13c + 1cb6e8b commit 404f0ed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rrze/wp",
"description": "A general purpose library for WordPress.",
"version": "1.2.0",
"version": "1.2.1",
"type": "library",
"keywords": [
"wordpress"
Expand Down
4 changes: 2 additions & 2 deletions src/Settings/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct($section, $type, $args = [])
$this->type = $type;
$this->args = $args;

$type_map = apply_filters('rrze_wp_settings_option_type_map', [
$typeMap = apply_filters('rrze_wp_settings_option_type_map', [
'text' => Text::class,
'checkbox' => Checkbox::class,
'choices' => Choices::class,
Expand All @@ -44,7 +44,7 @@ public function __construct($section, $type, $args = [])
'color' => Color::class,
]);

$this->implementation = new $type_map[$this->type]($section, $args);
$this->implementation = new $typeMap[$this->type]($section, $args);
}

public function getArg($key, $fallback = null)
Expand Down
4 changes: 2 additions & 2 deletions src/Settings/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,13 @@ public function save()
foreach ($section->options as $option) {
$value = $submittedOptions[$option->implementation->getName()] ?? null;

$valid = $option->implementation->validate($value);
$valid = $option->validate($value);

if (!$valid) {
continue;
}

$value = apply_filters('rrze_wp_settings_new_options_' . $option->implementation->getName(), $option->implementation->sanitize($value), $option->implementation);
$value = apply_filters('rrze_wp_settings_new_options_' . $option->implementation->getName(), $option->sanitize($value), $option->implementation);

$newOptions[$option->implementation->getName()] = $value;
}
Expand Down

0 comments on commit 404f0ed

Please sign in to comment.