Category Order and Taxonomy Terms Order - Version 1.5.7.7

Version Description

  • Minor code updates
    • Code cleanup
    • Compatibility tag update for WordPress 5.8.1
Download this release

Release Info

Developer nsp-code
Plugin Icon 128x128 Category Order and Taxonomy Terms Order
Version 1.5.7.7
Comparing to
See all releases

Code changes from version 1.5.7.6 to 1.5.7.7

include/addons.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
-
 
 
3
  //Co-Authors Plus fix
4
  add_action ('to/get_terms_orderby/ignore', 'to_get_terms_orderby_ignore_coauthors', 10, 3);
5
  function to_get_terms_orderby_ignore_coauthors( $ignore, $orderby, $args )
1
  <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
+
5
  //Co-Authors Plus fix
6
  add_action ('to/get_terms_orderby/ignore', 'to_get_terms_orderby_ignore_coauthors', 10, 3);
7
  function to_get_terms_orderby_ignore_coauthors( $ignore, $orderby, $args )
include/functions.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
 
 
3
 
4
  /**
5
  * Return default plugin options
@@ -53,21 +54,7 @@
53
  <div id="p_right">
54
 
55
  <div id="p_socialize">
56
-
57
- <div class="p_s_item s_f">
58
- <div id="fb-root"></div>
59
- <script>(function(d, s, id) {
60
- var js, fjs = d.getElementsByTagName(s)[0];
61
- if (d.getElementById(id)) return;
62
- js = d.createElement(s); js.id = id;
63
- js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5";
64
- fjs.parentNode.insertBefore(js, fjs);
65
- }(document, 'script', 'facebook-jssdk'));</script>
66
-
67
- <div class="fb-like" data-href="https://www.facebook.com/Nsp-Code-190329887674484/" data-layout="button_count" data-action="like" data-show-faces="true" data-share="false"></div>
68
-
69
- </div>
70
-
71
  <div class="p_s_item s_t">
72
  <a href="https://twitter.com/share" class="twitter-share-button" data-url="https://www.nsp-code.com" data-text="Define custom order for your post types through an easy to use javascript AJAX drag and drop interface. No theme code updates are necessarily, this plugin will take care of query update." data-count="none">Tweet</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
73
  </div>
1
  <?php
2
 
3
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
 
5
  /**
6
  * Return default plugin options
54
  <div id="p_right">
55
 
56
  <div id="p_socialize">
57
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  <div class="p_s_item s_t">
59
  <a href="https://twitter.com/share" class="twitter-share-button" data-url="https://www.nsp-code.com" data-text="Define custom order for your post types through an easy to use javascript AJAX drag and drop interface. No theme code updates are necessarily, this plugin will take care of query update." data-count="none">Tweet</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
60
  </div>
include/interface.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
 
3
-
 
4
  function TOPluginInterface()
5
  {
6
  global $wpdb, $wp_locale;
@@ -34,7 +35,6 @@
34
 
35
  ?>
36
  <div class="wrap">
37
- <div class="icon32" id="icon-edit"><br></div>
38
  <h2><?php _e( "Taxonomy Order", 'taxonomy-terms-order' ) ?></h2>
39
 
40
  <?php tto_info_box() ?>
@@ -71,7 +71,7 @@
71
  <input type="hidden" name="page" value="to-interface-<?php echo esc_attr($post_type) ?>" />
72
  <?php
73
 
74
- if (!in_array($post_type, array('post', 'attachment')))
75
  echo '<input type="hidden" name="post_type" value="'. esc_attr($post_type) .'" />';
76
 
77
  //output all available taxonomies for this post type
@@ -139,9 +139,7 @@
139
  ?>
140
 
141
  <div id="order-terms">
142
-
143
-
144
-
145
  <div id="post-body">
146
 
147
  <ul class="sortable" id="tto_sortable">
1
  <?php
2
 
3
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
+
5
  function TOPluginInterface()
6
  {
7
  global $wpdb, $wp_locale;
35
 
36
  ?>
37
  <div class="wrap">
 
38
  <h2><?php _e( "Taxonomy Order", 'taxonomy-terms-order' ) ?></h2>
39
 
40
  <?php tto_info_box() ?>
71
  <input type="hidden" name="page" value="to-interface-<?php echo esc_attr($post_type) ?>" />
72
  <?php
73
 
74
+ if (!in_array($post_type, array('post', 'attachment')))
75
  echo '<input type="hidden" name="post_type" value="'. esc_attr($post_type) .'" />';
76
 
77
  //output all available taxonomies for this post type
139
  ?>
140
 
141
  <div id="order-terms">
142
+
 
 
143
  <div id="post-body">
144
 
145
  <ul class="sortable" id="tto_sortable">
include/options.php CHANGED
@@ -1,91 +1,92 @@
1
  <?php
2
 
3
-
4
- function to_plugin_options()
5
- {
6
- $options = tto_get_settings();
7
-
8
- if (isset($_POST['to_form_submit']) && wp_verify_nonce($_POST['to_form_nonce'],'to_form_submit') )
9
- {
10
-
11
- $options['capability'] = sanitize_key($_POST['capability']);
12
-
13
- $options['autosort'] = isset($_POST['autosort']) ? intval($_POST['autosort']) : '';
14
- $options['adminsort'] = isset($_POST['adminsort']) ? intval($_POST['adminsort']) : '';
15
-
16
- ?><div class="updated fade"><p><?php _e('Settings Saved', 'taxonomy-terms-order') ?></p></div><?php
17
-
18
- update_option('tto_options', $options);
19
- }
20
 
21
- ?>
22
- <div class="wrap">
 
 
23
 
24
- <h2><?php _e( "General Settings", 'taxonomy-terms-order' ) ?></h2>
 
 
 
25
 
26
- <?php tto_info_box() ?>
27
-
28
- <form id="form_data" name="form" method="post">
29
- <br />
30
- <h2 class="subtitle"><?php _e( "General", 'taxonomy-terms-order' ) ?></h2>
31
- <table class="form-table">
32
- <tbody>
33
 
34
- <tr valign="top">
35
- <th scope="row" style="text-align: right;"><label><?php _e( "Minimum Level to use this plugin", 'taxonomy-terms-order' ) ?></label></th>
36
- <td>
37
- <select id="role" name="capability">
38
- <option value="read" <?php if (isset($options['capability']) && $options['capability'] == "read") echo 'selected="selected"'?>><?php _e('Subscriber', 'taxonomy-terms-order') ?></option>
39
- <option value="edit_posts" <?php if (isset($options['capability']) && $options['capability'] == "edit_posts") echo 'selected="selected"'?>><?php _e('Contributor', 'taxonomy-terms-order') ?></option>
40
- <option value="publish_posts" <?php if (isset($options['capability']) && $options['capability'] == "publish_posts") echo 'selected="selected"'?>><?php _e('Author', 'taxonomy-terms-order') ?></option>
41
- <option value="publish_pages" <?php if (isset($options['capability']) && $options['capability'] == "publish_pages") echo 'selected="selected"'?>><?php _e('Editor', 'taxonomy-terms-order') ?></option>
42
- <option value="manage_options" <?php if (!isset($options['capability']) || empty($options['capability']) || (isset($options['capability']) && $options['capability'] == "manage_options")) echo 'selected="selected"'?>><?php _e('Administrator', 'taxonomy-terms-order') ?></option>
43
- </select>
44
- </td>
45
- </tr>
46
-
47
-
48
- <tr valign="top">
49
- <th scope="row" style="text-align: right;"><label><?php _e( "Auto Sort", 'taxonomy-terms-order' ) ?></label></th>
50
- <td>
51
- <select id="autosort" name="autosort">
52
- <option value="0" <?php if ($options['autosort'] == "0") echo 'selected="selected"'?>><?php _e('OFF', 'taxonomy-terms-order') ?></option>
53
- <option value="1" <?php if ($options['autosort'] == "1") echo 'selected="selected"'?>><?php _e('ON', 'taxonomy-terms-order') ?></option>
54
- </select>
55
- <label for="autosort"> *(<?php _e( "global setting", 'taxonomy-terms-order' ) ?>) <?php _e( "Additional description and details at ", 'taxonomy-terms-order' ) ?><a target="_blank" href="https://www.nsp-code.com/taxonomy-terms-order-and-auto-sort-admin-sort-description-an-usage/"><?php _e( "Auto Sort Description", 'taxonomy-terms-order' ) ?></a></label>
56
- </td>
57
- </tr>
58
-
59
- <tr valign="top">
60
- <th scope="row" style="text-align: right;"><label><?php _e( "Admin Sort", 'taxonomy-terms-order' ) ?></label></th>
61
- <td>
62
- <select id="adminsort" name="adminsort">
63
- <option value="0" <?php if ($options['adminsort'] == "0") echo 'selected="selected"'?>><?php _e('OFF', 'taxonomy-terms-order') ?></option>
64
- <option value="1" <?php if ($options['adminsort'] == "1") echo 'selected="selected"'?>><?php _e('ON', 'taxonomy-terms-order') ?></option>
65
- </select>
66
- <label for="adminsort"><?php _e("This will change the order of terms within the admin interface", 'taxonomy-terms-order') ?>. <?php _e( "Additional description and details at ", 'taxonomy-terms-order' ) ?><a target="_blank" href="https://www.nsp-code.com/taxonomy-terms-order-and-auto-sort-admin-sort-description-an-usage/"><?php _e( "Auto Sort Description", 'taxonomy-terms-order' ) ?></a></label>
67
- </td>
68
- </tr>
69
-
70
-
71
-
72
- </tbody>
73
- </table>
74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
 
76
- <p class="submit">
77
- <input type="submit" name="Submit" class="button-primary" value="<?php _e('Save Settings', 'taxonomy-terms-order') ?>">
78
- </p>
79
-
80
- <?php wp_nonce_field('to_form_submit','to_form_nonce'); ?>
81
- <input type="hidden" name="to_form_submit" value="true" />
82
 
83
- </form>
84
-
85
- <?php
86
- echo '</div>';
87
-
88
-
89
- }
 
 
 
90
 
91
  ?>
1
  <?php
2
 
3
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
+
5
+ function to_plugin_options()
6
+ {
7
+ $options = tto_get_settings();
8
+
9
+ if (isset($_POST['to_form_submit']) && wp_verify_nonce($_POST['to_form_nonce'],'to_form_submit') )
10
+ {
 
 
 
 
 
 
 
 
 
11
 
12
+ $options['capability'] = sanitize_key($_POST['capability']);
13
+
14
+ $options['autosort'] = isset($_POST['autosort']) ? intval($_POST['autosort']) : '';
15
+ $options['adminsort'] = isset($_POST['adminsort']) ? intval($_POST['adminsort']) : '';
16
 
17
+ ?><div class="updated fade"><p><?php _e('Settings Saved', 'taxonomy-terms-order') ?></p></div><?php
18
+
19
+ update_option('tto_options', $options);
20
+ }
21
 
22
+ ?>
23
+ <div class="wrap">
 
 
 
 
 
24
 
25
+ <h2><?php _e( "General Settings", 'taxonomy-terms-order' ) ?></h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
 
27
+ <?php tto_info_box() ?>
28
+
29
+ <form id="form_data" name="form" method="post">
30
+ <br />
31
+ <h2 class="subtitle"><?php _e( "General", 'taxonomy-terms-order' ) ?></h2>
32
+ <table class="form-table">
33
+ <tbody>
34
+
35
+ <tr valign="top">
36
+ <th scope="row" style="text-align: right;"><label><?php _e( "Minimum Level to use this plugin", 'taxonomy-terms-order' ) ?></label></th>
37
+ <td>
38
+ <select id="role" name="capability">
39
+ <option value="read" <?php if (isset($options['capability']) && $options['capability'] == "read") echo 'selected="selected"'?>><?php _e('Subscriber', 'taxonomy-terms-order') ?></option>
40
+ <option value="edit_posts" <?php if (isset($options['capability']) && $options['capability'] == "edit_posts") echo 'selected="selected"'?>><?php _e('Contributor', 'taxonomy-terms-order') ?></option>
41
+ <option value="publish_posts" <?php if (isset($options['capability']) && $options['capability'] == "publish_posts") echo 'selected="selected"'?>><?php _e('Author', 'taxonomy-terms-order') ?></option>
42
+ <option value="publish_pages" <?php if (isset($options['capability']) && $options['capability'] == "publish_pages") echo 'selected="selected"'?>><?php _e('Editor', 'taxonomy-terms-order') ?></option>
43
+ <option value="manage_options" <?php if (!isset($options['capability']) || empty($options['capability']) || (isset($options['capability']) && $options['capability'] == "manage_options")) echo 'selected="selected"'?>><?php _e('Administrator', 'taxonomy-terms-order') ?></option>
44
+ </select>
45
+ </td>
46
+ </tr>
47
+
48
+
49
+ <tr valign="top">
50
+ <th scope="row" style="text-align: right;"><label><?php _e( "Auto Sort", 'taxonomy-terms-order' ) ?></label></th>
51
+ <td>
52
+ <select id="autosort" name="autosort">
53
+ <option value="0" <?php if ($options['autosort'] == "0") echo 'selected="selected"'?>><?php _e('OFF', 'taxonomy-terms-order') ?></option>
54
+ <option value="1" <?php if ($options['autosort'] == "1") echo 'selected="selected"'?>><?php _e('ON', 'taxonomy-terms-order') ?></option>
55
+ </select>
56
+ <label for="autosort"> *(<?php _e( "global setting", 'taxonomy-terms-order' ) ?>) <?php _e( "Additional description and details at ", 'taxonomy-terms-order' ) ?><a target="_blank" href="https://www.nsp-code.com/taxonomy-terms-order-and-auto-sort-admin-sort-description-an-usage/"><?php _e( "Auto Sort Description", 'taxonomy-terms-order' ) ?></a></label>
57
+ </td>
58
+ </tr>
59
+
60
+ <tr valign="top">
61
+ <th scope="row" style="text-align: right;"><label><?php _e( "Admin Sort", 'taxonomy-terms-order' ) ?></label></th>
62
+ <td>
63
+ <select id="adminsort" name="adminsort">
64
+ <option value="0" <?php if ($options['adminsort'] == "0") echo 'selected="selected"'?>><?php _e('OFF', 'taxonomy-terms-order') ?></option>
65
+ <option value="1" <?php if ($options['adminsort'] == "1") echo 'selected="selected"'?>><?php _e('ON', 'taxonomy-terms-order') ?></option>
66
+ </select>
67
+ <label for="adminsort"><?php _e("This will change the order of terms within the admin interface", 'taxonomy-terms-order') ?>. <?php _e( "Additional description and details at ", 'taxonomy-terms-order' ) ?><a target="_blank" href="https://www.nsp-code.com/taxonomy-terms-order-and-auto-sort-admin-sort-description-an-usage/"><?php _e( "Auto Sort Description", 'taxonomy-terms-order' ) ?></a></label>
68
+ </td>
69
+ </tr>
70
+
71
+
72
+
73
+ </tbody>
74
+ </table>
75
+
76
 
77
+ <p class="submit">
78
+ <input type="submit" name="Submit" class="button-primary" value="<?php _e('Save Settings', 'taxonomy-terms-order') ?>">
79
+ </p>
 
 
 
80
 
81
+ <?php wp_nonce_field('to_form_submit','to_form_nonce'); ?>
82
+ <input type="hidden" name="to_form_submit" value="true" />
83
+
84
+ </form>
85
+
86
+ <?php
87
+ echo '</div>';
88
+
89
+
90
+ }
91
 
92
  ?>
include/terms_walker.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
 
3
-
 
4
  class TO_Terms_Walker extends Walker
5
  {
6
 
1
  <?php
2
 
3
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
+
5
  class TO_Terms_Walker extends Walker
6
  {
7
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: nsp-code
3
  Donate link: http://www.nsp-code.com/donate.php
4
  Tags: category order,terms order, taxonomy order, admin order, categories sort, order category
5
  Requires at least: 2.8
6
- Tested up to: 5.7
7
- Stable tag: 1.5.7.5
8
 
9
  Order Categories and all custom taxonomies terms (hierarchically) and child terms using a Drag and Drop Sortable javascript capability.
10
 
@@ -59,6 +59,11 @@ Consider upgrading to our advanced version of this plugin at a very resonable pr
59
 
60
  == Change Log ==
61
 
 
 
 
 
 
62
  = 1.5.7.6 =
63
  - Clear the term cache to ensure the updated order reflect for certain caches
64
 
3
  Donate link: http://www.nsp-code.com/donate.php
4
  Tags: category order,terms order, taxonomy order, admin order, categories sort, order category
5
  Requires at least: 2.8
6
+ Tested up to: 5.8.1
7
+ Stable tag: 1.5.7.7
8
 
9
  Order Categories and all custom taxonomies terms (hierarchically) and child terms using a Drag and Drop Sortable javascript capability.
10
 
59
 
60
  == Change Log ==
61
 
62
+ = 1.5.7.7 =
63
+ - Minor code updates
64
+ - Code cleanup
65
+ - Compatibility tag update for WordPress 5.8.1
66
+
67
  = 1.5.7.6 =
68
  - Clear the term cache to ensure the updated order reflect for certain caches
69
 
taxonomy-terms-order.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Category Order and Taxonomy Terms Order
4
  Plugin URI: http://www.nsp-code.com
5
  Description: Order Categories and all custom taxonomies terms (hierarchically) and child terms using a Drag and Drop Sortable javascript capability.
6
- Version: 1.5.7.6
7
  Author: Nsp-Code
8
  Author URI: https://www.nsp-code.com
9
  Author Email: electronice_delphi@yahoo.com
3
  Plugin Name: Category Order and Taxonomy Terms Order
4
  Plugin URI: http://www.nsp-code.com
5
  Description: Order Categories and all custom taxonomies terms (hierarchically) and child terms using a Drag and Drop Sortable javascript capability.
6
+ Version: 1.5.7.7
7
  Author: Nsp-Code
8
  Author URI: https://www.nsp-code.com
9
  Author Email: electronice_delphi@yahoo.com