From 13accd89b289370701305e6b36fa6a4b67039d9a Mon Sep 17 00:00:00 2001 From: kagg-design Date: Mon, 5 Aug 2024 11:36:52 +0300 Subject: [PATCH] Do not save file field. --- src/php/Settings/Abstracts/SettingsBase.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/php/Settings/Abstracts/SettingsBase.php b/src/php/Settings/Abstracts/SettingsBase.php index f6c26afa..0762660c 100644 --- a/src/php/Settings/Abstracts/SettingsBase.php +++ b/src/php/Settings/Abstracts/SettingsBase.php @@ -1488,6 +1488,11 @@ public function pre_update_option_filter( $value, $old_value ) { $old_value = is_array( $old_value ) ? $old_value : []; foreach ( $this->form_fields() as $key => $form_field ) { + if ( 'file' === $form_field['type'] ) { + unset( $value[ $key ], $old_value[ $key ] ); + continue; + } + if ( 'checkbox' !== $form_field['type'] || isset( $value[ $key ] ) ) { continue; }