diff --git a/Aeria/Aeria.php b/Aeria/Aeria.php index 47c0939..8be944d 100755 --- a/Aeria/Aeria.php +++ b/Aeria/Aeria.php @@ -31,7 +31,7 @@ */ class Aeria extends Container { - const VERSION = '3.1.12'; + const VERSION = '3.1.13'; /** * Constructs the Aeria container. diff --git a/Aeria/Field/Fields/SwitchField.php b/Aeria/Field/Fields/SwitchField.php index 7fa9d40..7b0d31c 100644 --- a/Aeria/Field/Fields/SwitchField.php +++ b/Aeria/Field/Fields/SwitchField.php @@ -36,6 +36,24 @@ public function get(array $saved_fields, bool $skip_filter = false) return $result; } + /** + * Gets the field's value and its errors. + * + * @param array $saved_fields the FieldGroup's saved fields + * @param array $errors the saving errors + * + * @return array the field's config, hydrated with values and errors + * + * @since Method available since Release 3.0.0 + */ + public function getAdmin(array $saved_fields, array $errors) + { + $savedValues = parent::getAdmin($saved_fields, $errors, true); + $savedValues['value'] = is_null($savedValues['value']) ? null : filter_var($savedValues['value'], FILTER_VALIDATE_BOOLEAN); + + return $savedValues; + } + /** * Saves the new values to the fields. * diff --git a/aeria.php b/aeria.php index fe8d02a..b8e26e7 100755 --- a/aeria.php +++ b/aeria.php @@ -10,7 +10,7 @@ * Plugin Name: Aeria * Plugin URI: https://github.com/caffeinalab/aeria * Description: Aeria is a modular, lightweight, fast WordPress Application development kit. - * Version: 3.1.12 + * Version: 3.1.13 * Author: Caffeina * Author URI: https://caffeina.com * Text Domain: aeria diff --git a/package-lock.json b/package-lock.json index 3c517b2..80a547b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "aeria", - "version": "3.1.12", + "version": "3.1.13", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f5679b7..c81004b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aeria", - "version": "3.1.12", + "version": "3.1.13", "description": "Aeria", "scripts": { "dev": "webpack --watch --mode development",