forked from Michel2/wp-jquery-datatable
Changed the radio buttons on the options page to use the WordPress checked() function
This commit is contained in:
@@ -85,6 +85,7 @@ Is this plugin prepared for multisites? Yes.
|
|||||||
* Deleted the setting of unnecessary variables under wp_jdt_activate_plugin() and made all the if statements strict.
|
* Deleted the setting of unnecessary variables under wp_jdt_activate_plugin() and made all the if statements strict.
|
||||||
* Changed the user role for the options page from 'administrator' to 'manage_options'.
|
* 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.
|
* 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.
|
||||||
|
|
||||||
= 4.1.0 =
|
= 4.1.0 =
|
||||||
* Compatibility with WordPress version 6.7.1
|
* Compatibility with WordPress version 6.7.1
|
||||||
|
|||||||
+16
-110
@@ -100,19 +100,8 @@ function wp_jdt_settings_page()
|
|||||||
<th scope='row'><?php _e('Show Information', 'wp-jquery-datatable'); ?></th>
|
<th scope='row'><?php _e('Show Information', 'wp-jquery-datatable'); ?></th>
|
||||||
<td>
|
<td>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<?php
|
<label title="<?php _e('Yes'); ?>"><input type="radio" <?php checked($wp_jdt_info, 'true'); ?> value="true" name="wp_jdt_info"> <span><?php _e('Yes'); ?></span></label><br>
|
||||||
if ($wp_jdt_info != "false") {
|
<label title="<?php _e('No'); ?>"><input type="radio" <?php checked($wp_jdt_info, 'false'); ?> value="false" name="wp_jdt_info"> <span><?php _e('No'); ?></span></label><br>
|
||||||
?>
|
|
||||||
<label title="<?php _e('Yes'); ?>"><input type="radio" checked="checked" value="true" name="wp_jdt_info"> <span><?php _e('Yes'); ?></span></label><br>
|
|
||||||
<label title="<?php _e('No'); ?>"><input type="radio" value="false" name="wp_jdt_info"> <span><?php _e('No'); ?></span></label><br>
|
|
||||||
<?php
|
|
||||||
} else {
|
|
||||||
?>
|
|
||||||
<label title="<?php _e('Yes'); ?>"><input type="radio" value="true" name="wp_jdt_info"> <span><?php _e('Yes'); ?></span></label><br>
|
|
||||||
<label title="<?php _e('No'); ?>"><input type="radio" checked="checked" value="false" name="wp_jdt_info"> <span><?php _e('No'); ?></span></label><br>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -121,19 +110,8 @@ function wp_jdt_settings_page()
|
|||||||
<th scope='row'><?php _e('Pagination'); ?></th>
|
<th scope='row'><?php _e('Pagination'); ?></th>
|
||||||
<td>
|
<td>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<?php
|
<label title="<?php _e('Yes'); ?>"><input type="radio" <?php checked($wp_jdt_paging, 'true'); ?> value="true" name="wp_jdt_paging"> <span><?php _e('Yes'); ?></span></label><br>
|
||||||
if ($wp_jdt_paging != "false") {
|
<label title="<?php _e('No'); ?>"><input type="radio" <?php checked($wp_jdt_paging, 'false'); ?> value="false" name="wp_jdt_paging"> <span><?php _e('No'); ?></span></label><br>
|
||||||
?>
|
|
||||||
<label title="<?php _e('Yes'); ?>"><input type="radio" checked="checked" value="true" name="wp_jdt_paging"> <span><?php _e('Yes'); ?></span></label><br>
|
|
||||||
<label title="<?php _e('No'); ?>"><input type="radio" value="false" name="wp_jdt_paging"> <span><?php _e('No'); ?></span></label><br>
|
|
||||||
<?php
|
|
||||||
} else {
|
|
||||||
?>
|
|
||||||
<label title="<?php _e('Yes'); ?>"><input type="radio" value="true" name="wp_jdt_paging"> <span><?php _e('Yes'); ?></span></label><br>
|
|
||||||
<label title="<?php _e('No'); ?>"><input type="radio" checked="checked" value="false" name="wp_jdt_paging"> <span><?php _e('No'); ?></span></label><br>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -142,38 +120,10 @@ function wp_jdt_settings_page()
|
|||||||
<th scope='row'><?php _e('Pagination Type', 'wp-jquery-datatable'); ?></th>
|
<th scope='row'><?php _e('Pagination Type', 'wp-jquery-datatable'); ?></th>
|
||||||
<td>
|
<td>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<?php
|
<label title="<?php _e('Simple', 'wp-jquery-datatable'); ?>"><input type="radio" <?php checked($wp_jdt_paging_type, 'simple'); ?> value="simple" name="wp_jdt_paging_type"> <span><?php _e('Simple', 'wp-jquery-datatable'); ?></span></label><br>
|
||||||
if ($wp_jdt_paging_type == "full_numbers") {
|
<label title="<?php _e('Simple Numbers', 'wp-jquery-datatable'); ?>"><input type="radio" <?php checked($wp_jdt_paging_type, 'simple_numbers'); ?> value="simple_numbers" name="wp_jdt_paging_type"> <span><?php _e('Simple Numbers', 'wp-jquery-datatable'); ?></span></label><br>
|
||||||
?>
|
<label title="<?php _e('Full', 'wp-jquery-datatable'); ?>"><input type="radio" <?php checked($wp_jdt_paging_type, 'full'); ?> value="full" name="wp_jdt_paging_type"> <span><?php _e('Full', 'wp-jquery-datatable'); ?></span></label><br>
|
||||||
<label title="<?php _e('Simple', 'wp-jquery-datatable'); ?>"><input type="radio" value="simple" name="wp_jdt_paging_type"> <span><?php _e('Simple', 'wp-jquery-datatable'); ?></span></label><br>
|
<label title="<?php _e('Full Numbers', 'wp-jquery-datatable'); ?>"><input type="radio" <?php checked($wp_jdt_paging_type, 'full_numbers'); ?> value="full_numbers" name="wp_jdt_paging_type"> <span><?php _e('Full Numbers', 'wp-jquery-datatable'); ?></span></label><br>
|
||||||
<label title="<?php _e('Simple Numbers', 'wp-jquery-datatable'); ?>"><input type="radio" value="simple_numbers" name="wp_jdt_paging_type"> <span><?php _e('Simple Numbers', 'wp-jquery-datatable'); ?></span></label><br>
|
|
||||||
<label title="<?php _e('Full', 'wp-jquery-datatable'); ?>"><input type="radio" value="full" name="wp_jdt_paging_type"> <span><?php _e('Full', 'wp-jquery-datatable'); ?></span></label><br>
|
|
||||||
<label title="<?php _e('Full Numbers', 'wp-jquery-datatable'); ?>"><input type="radio" checked="checked" value="full_numbers" name="wp_jdt_paging_type"> <span><?php _e('Full Numbers', 'wp-jquery-datatable'); ?></span></label><br>
|
|
||||||
<?php
|
|
||||||
} else if ($wp_jdt_paging_type == "full") {
|
|
||||||
?>
|
|
||||||
<label title="<?php _e('Simple', 'wp-jquery-datatable'); ?>"><input type="radio" value="simple" name="wp_jdt_paging_type"> <span><?php _e('Simple', 'wp-jquery-datatable'); ?></span></label><br>
|
|
||||||
<label title="<?php _e('Simple Numbers', 'wp-jquery-datatable'); ?>"><input type="radio" value="simple_numbers" name="wp_jdt_paging_type"> <span><?php _e('Simple Numbers', 'wp-jquery-datatable'); ?></span></label><br>
|
|
||||||
<label title="<?php _e('Full', 'wp-jquery-datatable'); ?>"><input type="radio" checked="checked" value="full" name="wp_jdt_paging_type"> <span><?php _e('Full', 'wp-jquery-datatable'); ?></span></label><br>
|
|
||||||
<label title="<?php _e('Full Numbers', 'wp-jquery-datatable'); ?>"><input type="radio" value="full_numbers" name="wp_jdt_paging_type"> <span><?php _e('Full Numbers', 'wp-jquery-datatable'); ?></span></label><br>
|
|
||||||
<?php
|
|
||||||
} else if ($wp_jdt_paging_type == "simple_numbers") {
|
|
||||||
?>
|
|
||||||
<label title="<?php _e('Simple', 'wp-jquery-datatable'); ?>"><input type="radio" value="simple" name="wp_jdt_paging_type"> <span><?php _e('Simple', 'wp-jquery-datatable'); ?></span></label><br>
|
|
||||||
<label title="<?php _e('Simple Numbers', 'wp-jquery-datatable'); ?>"><input type="radio" checked="checked" value="simple_numbers" name="wp_jdt_paging_type"> <span><?php _e('Simple Numbers', 'wp-jquery-datatable'); ?></span></label><br>
|
|
||||||
<label title="<?php _e('Full', 'wp-jquery-datatable'); ?>"><input type="radio" value="full" name="wp_jdt_paging_type"> <span><?php _e('Full', 'wp-jquery-datatable'); ?></span></label><br>
|
|
||||||
<label title="<?php _e('Full Numbers', 'wp-jquery-datatable'); ?>"><input type="radio" value="full_numbers" name="wp_jdt_paging_type"> <span><?php _e('Full Numbers', 'wp-jquery-datatable'); ?></span></label><br>
|
|
||||||
<?php
|
|
||||||
} else {
|
|
||||||
?>
|
|
||||||
<label title="<?php _e('Simple', 'wp-jquery-datatable'); ?>"><input type="radio" checked="checked" value="simple" name="wp_jdt_paging_type"> <span><?php _e('Simple', 'wp-jquery-datatable'); ?></span></label><br>
|
|
||||||
<label title="<?php _e('Simple Numbers', 'wp-jquery-datatable'); ?>"><input type="radio" value="simple_numbers" name="wp_jdt_paging_type"> <span><?php _e('Simple Numbers', 'wp-jquery-datatable'); ?></span></label><br>
|
|
||||||
<label title="<?php _e('Full', 'wp-jquery-datatable'); ?>"><input type="radio" value="full" name="wp_jdt_paging_type"> <span><?php _e('Full', 'wp-jquery-datatable'); ?></span></label><br>
|
|
||||||
<label title="<?php _e('Full Numbers', 'wp-jquery-datatable'); ?>"><input type="radio" value="full_numbers" name="wp_jdt_paging_type"> <span><?php _e('Full Numbers', 'wp-jquery-datatable'); ?></span></label><br>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -193,19 +143,8 @@ function wp_jdt_settings_page()
|
|||||||
<th scope='row'><?php _e('Show Per Page DropDown', 'wp-jquery-datatable'); ?></th>
|
<th scope='row'><?php _e('Show Per Page DropDown', 'wp-jquery-datatable'); ?></th>
|
||||||
<td>
|
<td>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<?php
|
<label title="<?php _e('Yes'); ?>"><input type="radio" <?php checked($wp_jdt_b_length_change, 'true'); ?> value="true" name="wp_jdt_b_length_change"> <span><?php _e('Yes'); ?></span></label><br>
|
||||||
if ($wp_jdt_b_length_change != "false") {
|
<label title="<?php _e('No'); ?>"><input type="radio" <?php checked($wp_jdt_b_length_change, 'false'); ?> value="false" name="wp_jdt_b_length_change"> <span><?php _e('No'); ?></span></label><br>
|
||||||
?>
|
|
||||||
<label title="<?php _e('Yes'); ?>"><input type="radio" checked="checked" value="true" name="wp_jdt_b_length_change"> <span><?php _e('Yes'); ?></span></label><br>
|
|
||||||
<label title="<?php _e('No'); ?>"><input type="radio" value="false" name="wp_jdt_b_length_change"> <span><?php _e('No'); ?></span></label><br>
|
|
||||||
<?php
|
|
||||||
} else {
|
|
||||||
?>
|
|
||||||
<label title="<?php _e('Yes'); ?>"><input type="radio" value="true" name="wp_jdt_b_length_change"> <span><?php _e('Yes'); ?></span></label><br>
|
|
||||||
<label title="<?php _e('No'); ?>"><input type="radio" checked="checked" value="false" name="wp_jdt_b_length_change"> <span><?php _e('No'); ?></span></label><br>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -214,19 +153,8 @@ function wp_jdt_settings_page()
|
|||||||
<th scope='row'><?php _e('Ordering', 'wp-jquery-datatable'); ?></th>
|
<th scope='row'><?php _e('Ordering', 'wp-jquery-datatable'); ?></th>
|
||||||
<td>
|
<td>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<?php
|
<label title="<?php _e('Yes'); ?>"><input type="radio" <?php checked($wp_jdt_ordering, 'true'); ?> value="true" name="wp_jdt_ordering"> <span><?php _e('Yes'); ?></span></label><br>
|
||||||
if ($wp_jdt_ordering != "false") {
|
<label title="<?php _e('No'); ?>"><input type="radio" <?php checked($wp_jdt_ordering, 'false'); ?> value="false" name="wp_jdt_ordering"> <span><?php _e('No'); ?></span></label><br>
|
||||||
?>
|
|
||||||
<label title="<?php _e('Yes'); ?>"><input type="radio" checked="checked" value="true" name="wp_jdt_ordering"> <span><?php _e('Yes'); ?></span></label><br>
|
|
||||||
<label title="<?php _e('No'); ?>"><input type="radio" value="false" name="wp_jdt_ordering"> <span><?php _e('No'); ?></span></label><br>
|
|
||||||
<?php
|
|
||||||
} else {
|
|
||||||
?>
|
|
||||||
<label title="<?php _e('Yes'); ?>"><input type="radio" value="true" name="wp_jdt_ordering"> <span><?php _e('Yes'); ?></span></label><br>
|
|
||||||
<label title="<?php _e('No'); ?>"><input type="radio" checked="checked" value="false" name="wp_jdt_ordering"> <span><?php _e('No'); ?></span></label><br>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -241,19 +169,8 @@ function wp_jdt_settings_page()
|
|||||||
} ?>" min="0" step="1" name="wp_jdt_order_row"><br>
|
} ?>" min="0" step="1" name="wp_jdt_order_row"><br>
|
||||||
<br>
|
<br>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<?php
|
<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>
|
||||||
if ($wp_jdt_order_row_sort != "desc") {
|
<label title="<?php _e('Descending'); ?>"><input type="radio" <?php checked($wp_jdt_order_row_sort, 'desc'); ?> value="desc" name="wp_jdt_order_row_sort"> <span><?php _e('Descending'); ?></span></label><br>
|
||||||
?>
|
|
||||||
<label title="<?php _e('Ascending'); ?>"><input type="radio" checked="checked" value="asc" name="wp_jdt_order_row_sort"> <span><?php _e('Ascending'); ?></span></label><br>
|
|
||||||
<label title="<?php _e('Descending'); ?>"><input type="radio" value="desc" name="wp_jdt_order_row_sort"> <span><?php _e('Descending'); ?></span></label><br>
|
|
||||||
<?php
|
|
||||||
} else {
|
|
||||||
?>
|
|
||||||
<label title="<?php _e('Ascending'); ?>"><input type="radio" value="asc" name="wp_jdt_order_row_sort"> <span><?php _e('Ascending'); ?></span></label><br>
|
|
||||||
<label title="<?php _e('Descending'); ?>"><input type="radio" checked="checked" value="desc" name="wp_jdt_order_row_sort"> <span><?php _e('Descending'); ?></span></label><br>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -262,19 +179,8 @@ function wp_jdt_settings_page()
|
|||||||
<th scope='row'><?php _e('Searching', 'wp-jquery-datatable'); ?></th>
|
<th scope='row'><?php _e('Searching', 'wp-jquery-datatable'); ?></th>
|
||||||
<td>
|
<td>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<?php
|
<label title="<?php _e('Yes'); ?>"><input type="radio" <?php checked($wp_jdt_searching, 'true'); ?> value="true" name="wp_jdt_searching"> <span><?php _e('Yes'); ?></span></label><br>
|
||||||
if ($wp_jdt_searching != "false") {
|
<label title="<?php _e('No'); ?>"><input type="radio" <?php checked($wp_jdt_searching, 'false'); ?> value="false" name="wp_jdt_searching"> <span><?php _e('No'); ?></span></label><br>
|
||||||
?>
|
|
||||||
<label title="<?php _e('Yes'); ?>"><input type="radio" checked="checked" value="true" name="wp_jdt_searching"> <span><?php _e('Yes'); ?></span></label><br>
|
|
||||||
<label title="<?php _e('No'); ?>"><input type="radio" value="false" name="wp_jdt_searching"> <span><?php _e('No'); ?></span></label><br>
|
|
||||||
<?php
|
|
||||||
} else {
|
|
||||||
?>
|
|
||||||
<label title="<?php _e('Yes'); ?>"><input type="radio" value="true" name="wp_jdt_searching"> <span><?php _e('Yes'); ?></span></label><br>
|
|
||||||
<label title="<?php _e('No'); ?>"><input type="radio" checked="checked" value="false" name="wp_jdt_searching"> <span><?php _e('No'); ?></span></label><br>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user