Changed the registering of settings during installation to an array

This commit is contained in:
2026-07-21 17:10:20 +02:00
parent e84c5d66da
commit 3841f4e246
2 changed files with 16 additions and 9 deletions
+1
View File
@@ -80,6 +80,7 @@ Is this plugin prepared for multisites? Yes.
* Added VSCode settings.json for formatOnSave. * Added VSCode settings.json for formatOnSave.
* Added .gitignore. * Added .gitignore.
* Added security measurement to prevent the public to run the php-script directly. * Added security measurement to prevent the public to run the php-script directly.
* Changed the registering of settings during installation to an array.
= 4.1.0 = = 4.1.0 =
* Compatibility with WordPress version 6.7.1 * Compatibility with WordPress version 6.7.1
+15 -9
View File
@@ -63,15 +63,21 @@ function wp_jdt_create_menu()
function wp_jdt_settings() function wp_jdt_settings()
{ {
//register our settings //register our settings
register_setting('wp-jdt-settings-group', 'wp_jdt_info'); $settings = array(
register_setting('wp-jdt-settings-group', 'wp_jdt_paging'); 'wp_jdt_info',
register_setting('wp-jdt-settings-group', 'wp_jdt_page_length'); 'wp_jdt_paging',
register_setting('wp-jdt-settings-group', 'wp_jdt_paging_type'); 'wp_jdt_page_length',
register_setting('wp-jdt-settings-group', 'wp_jdt_b_length_change'); 'wp_jdt_paging_type',
register_setting('wp-jdt-settings-group', 'wp_jdt_ordering'); 'wp_jdt_b_length_change',
register_setting('wp-jdt-settings-group', 'wp_jdt_order_row'); 'wp_jdt_ordering',
register_setting('wp-jdt-settings-group', 'wp_jdt_order_row_sort'); 'wp_jdt_order_row',
register_setting('wp-jdt-settings-group', 'wp_jdt_searching'); 'wp_jdt_order_row_sort',
'wp_jdt_searching'
);
foreach ($settings as $setting) {
register_setting('wp-jdt-settings-group', $setting);
}
} }
function wp_jdt_settings_page() function wp_jdt_settings_page()