Changed get_option() for the options page to make use a $default_value

This commit is contained in:
2026-07-21 20:16:19 +02:00
parent d1db4ebbed
commit d42ff6fc14
2 changed files with 12 additions and 19 deletions
+1
View File
@@ -86,6 +86,7 @@ Is this plugin prepared for multisites? Yes.
* Changed the user role for the options page from 'administrator' to 'manage_options'.
* Added a check for the options page to only load if the user has sufficient rights.
* Changed the radio buttons on the options page to use the WordPress checked() function.
* Changed get_option() for the options page to make use a $default_value.
= 4.1.0 =
* Compatibility with WordPress version 6.7.1
+11 -19
View File
@@ -79,15 +79,15 @@ function wp_jdt_settings_page()
return;
}
$wp_jdt_info = get_option('wp_jdt_info');
$wp_jdt_paging = get_option('wp_jdt_paging');
$wp_jdt_page_length = get_option('wp_jdt_page_length');
$wp_jdt_paging_type = get_option('wp_jdt_paging_type');
$wp_jdt_b_length_change = get_option('wp_jdt_b_length_change');
$wp_jdt_ordering = get_option('wp_jdt_ordering');
$wp_jdt_order_row = get_option('wp_jdt_order_row');
$wp_jdt_order_row_sort = get_option('wp_jdt_order_row_sort');
$wp_jdt_searching = get_option('wp_jdt_searching');
$wp_jdt_info = get_option('wp_jdt_info', 'true');
$wp_jdt_paging = get_option('wp_jdt_paging', 'true');
$wp_jdt_page_length = get_option('wp_jdt_page_length', '10');
$wp_jdt_paging_type = get_option('wp_jdt_paging_type', 'simple');
$wp_jdt_b_length_change = get_option('wp_jdt_b_length_change', 'true');
$wp_jdt_ordering = get_option('wp_jdt_ordering', 'true');
$wp_jdt_order_row = get_option('wp_jdt_order_row', '0');
$wp_jdt_order_row_sort = get_option('wp_jdt_order_row_sort', 'asc');
$wp_jdt_searching = get_option('wp_jdt_searching', 'true');
?>
<div class='wrap'>
<h2><?php _e('WP jQuery DataTable Settings', 'wp-jquery-datatable'); ?></h2>
@@ -131,11 +131,7 @@ function wp_jdt_settings_page()
<tr valign='top'>
<th scope='row'><?php _e('Rows Per Page', 'wp-jquery-datatable'); ?></th>
<td>
<input type="number" class="small-text" value="<?php if ($wp_jdt_page_length != NULL) {
echo $wp_jdt_page_length;
} else {
echo "10";
} ?>" min="1" step="1" name="wp_jdt_page_length">
<input type="number" class="small-text" value="<?php echo $wp_jdt_page_length; ?>" min="1" step="1" name="wp_jdt_page_length">
</td>
</tr>
@@ -162,11 +158,7 @@ function wp_jdt_settings_page()
<tr valign='top'>
<th scope='row'><?php _e('Specific Column Order', 'wp-jquery-datatable'); ?></th>
<td>
<input type="number" class="small-text" value="<?php if ($wp_jdt_order_row != NULL) {
echo $wp_jdt_order_row;
} else {
echo "0";
} ?>" min="0" step="1" name="wp_jdt_order_row"><br>
<input type="number" class="small-text" value="<?php echo $wp_jdt_order_row; ?>" min="0" step="1" name="wp_jdt_order_row"><br>
<br>
<fieldset>
<label title="<?php _e('Ascending'); ?>"><input type="radio" <?php checked($wp_jdt_order_row_sort, 'asc'); ?> value="asc" name="wp_jdt_order_row_sort"> <span><?php _e('Ascending'); ?></span></label><br>