Custom Taxonomy Order NE - Version 3.2.2

Version Description

  • 2020-12-04
  • Fix category/tag edit screen, extra field.
  • Change 'strval()' to '(string)'.
  • Change 'floatval()' to '(float)'.
Download this release

Release Info

Developer mpol
Plugin Icon 128x128 Custom Taxonomy Order NE
Version 3.2.2
Comparing to
See all releases

Code changes from version 3.2.1 to 3.2.2

Files changed (3) hide show
  1. admin-customtaxorder.php +3 -2
  2. customtaxorder.php +5 -4
  3. readme.txt +8 -1
admin-customtaxorder.php CHANGED
@@ -96,6 +96,7 @@ add_action('admin_print_scripts', 'customtaxorder_js_libs');
96
  function customtaxorder_tag_edit_screen() {
97
 
98
  $taxonomies = customtaxorder_get_taxonomies() ;
 
99
 
100
  foreach ( $taxonomies as $taxonomy ) {
101
  if ( is_object($taxonomy) && isset($taxonomy->name) ) {
@@ -137,11 +138,11 @@ function customtaxorder_term_order_add_form_field( $taxonomy ) {
137
 
138
  /*
139
  * Output the "term_order" form field when editing an existing term.
140
- * @param object $term
141
  * @param string $taxonomy the name of the taxonomy.
142
  * @since 3.1.0
143
  */
144
- function customtaxorder_term_order_edit_form_field( $term = false, $taxonomy ) {
145
  $options = customtaxorder_get_settings();
146
  if ( isset($options[$taxonomy]) && $options[$taxonomy] == 1 ) {
147
  if ( is_object($term) && isset($term->term_order) ) {
96
  function customtaxorder_tag_edit_screen() {
97
 
98
  $taxonomies = customtaxorder_get_taxonomies() ;
99
+ $options = customtaxorder_get_settings();
100
 
101
  foreach ( $taxonomies as $taxonomy ) {
102
  if ( is_object($taxonomy) && isset($taxonomy->name) ) {
138
 
139
  /*
140
  * Output the "term_order" form field when editing an existing term.
141
+ * @param object $term WP_Term Current taxonomy term object.
142
  * @param string $taxonomy the name of the taxonomy.
143
  * @since 3.1.0
144
  */
145
+ function customtaxorder_term_order_edit_form_field( $term, $taxonomy ) {
146
  $options = customtaxorder_get_settings();
147
  if ( isset($options[$taxonomy]) && $options[$taxonomy] == 1 ) {
148
  if ( is_object($term) && isset($term->term_order) ) {
customtaxorder.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Custom Taxonomy Order
4
  Plugin URI: https://wordpress.org/plugins/custom-taxonomy-order-ne/
5
  Description: Allows for the ordering of categories and custom taxonomy terms through a simple drag-and-drop interface.
6
- Version: 3.2.1
7
  Author: Marcel Pol
8
  Author URI: https://timelord.nl/
9
  License: GPLv2 or later
@@ -40,7 +40,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
40
 
41
 
42
  // Plugin Version
43
- define('CUSTOMTAXORDER_VER', '3.2.1');
44
 
45
 
46
  /*
@@ -204,8 +204,9 @@ function customtaxorder_wp_get_object_terms_order_filter( $terms ) {
204
  $ancestor_ID = array_pop( $parents );
205
  $ancestor_term = get_term($ancestor_ID, $term->taxonomy);
206
  if ( is_object($ancestor_term) && isset($ancestor_term->term_order) ) {
207
- $float = floatval($term->term_order) + 10000;
208
- $term->term_order = floatval( strval($ancestor_term->term_order) . '.' . strval($float) );
 
209
  }
210
  }
211
  }
3
  Plugin Name: Custom Taxonomy Order
4
  Plugin URI: https://wordpress.org/plugins/custom-taxonomy-order-ne/
5
  Description: Allows for the ordering of categories and custom taxonomy terms through a simple drag-and-drop interface.
6
+ Version: 3.2.2
7
  Author: Marcel Pol
8
  Author URI: https://timelord.nl/
9
  License: GPLv2 or later
40
 
41
 
42
  // Plugin Version
43
+ define('CUSTOMTAXORDER_VER', '3.2.2');
44
 
45
 
46
  /*
204
  $ancestor_ID = array_pop( $parents );
205
  $ancestor_term = get_term($ancestor_ID, $term->taxonomy);
206
  if ( is_object($ancestor_term) && isset($ancestor_term->term_order) ) {
207
+ $float_front = (string) $ancestor_term->term_order;
208
+ $float_rear = (string) ( $term->term_order + 10000 ); // Make it sort correctly. Not many websites have more than 90000 subterms.
209
+ $term->term_order = (float) ( $float_front . '.' . $float_rear );
210
  }
211
  }
212
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: mpol
3
  Tags: term order, category order, taxonomy order, order
4
  Requires at least: 3.7
5
  Tested up to: 5.6
6
- Stable tag: 3.2.1
7
  License: GPLv2 or later
8
 
9
 
@@ -159,6 +159,13 @@ The left metabox lists the toplevel terms. Right (or below) are the sub-terms.
159
 
160
  == Changelog ==
161
 
 
 
 
 
 
 
 
162
  = 3.2.1 =
163
  * 2020-07-07
164
  * More compatibility with WPML plugin.
3
  Tags: term order, category order, taxonomy order, order
4
  Requires at least: 3.7
5
  Tested up to: 5.6
6
+ Stable tag: 3.2.2
7
  License: GPLv2 or later
8
 
9
 
159
 
160
  == Changelog ==
161
 
162
+ = 3.2.2 =
163
+ * 2020-12-04
164
+ * Fix category/tag edit screen, extra field.
165
+ * Change 'strval()' to '(string)'.
166
+ * Change 'floatval()' to '(float)'.
167
+
168
+
169
  = 3.2.1 =
170
  * 2020-07-07
171
  * More compatibility with WPML plugin.