diff --git a/composer.json b/composer.json index 93a03eb..2ec26d5 100644 --- a/composer.json +++ b/composer.json @@ -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" diff --git a/src/Settings/Option.php b/src/Settings/Option.php index 43714cb..e726cc5 100644 --- a/src/Settings/Option.php +++ b/src/Settings/Option.php @@ -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, @@ -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) diff --git a/src/Settings/Settings.php b/src/Settings/Settings.php index 992a4d9..ba5b864 100644 --- a/src/Settings/Settings.php +++ b/src/Settings/Settings.php @@ -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; }