Skip to content

Commit e9e2471

Browse files
committed
Add filter before plugin settings form submit
1 parent 7b9a086 commit e9e2471

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class framework {
1616
(include __DIR__ . '/module-loader.php')(new class {
1717

1818
public $name = 'tangible_framework';
19-
public $version = '20250415';
19+
public $version = '20250511';
2020

2121
function load() {
2222

plugin/settings/index.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,14 @@ class="tangible-plugin-settings-tab <?php echo $name; ?>-settings-tab <?php echo
246246
&& check_admin_referer($nonce_key, $nonce_key)
247247
) {
248248
$new_settings = $_POST[$settings_key];
249-
framework\update_plugin_settings($plugin, $new_settings);
249+
250+
$update_value = apply_filters('tangible_plugin_save_settings_on_submit',
251+
true, $plugin, $new_settings
252+
);
253+
254+
if ($update_value) {
255+
framework\update_plugin_settings($plugin, $new_settings);
256+
}
250257
}
251258

252259
/**

0 commit comments

Comments
 (0)