Category Order and Taxonomy Terms Order - Version 1.5.7

Version Description

  • Ignore WooCOmmerce Attributes order as being changed through default interface
Download this release

Release Info

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

Code changes from version 1.5.6 to 1.5.7

Files changed (3) hide show
  1. include/addons.php +31 -2
  2. readme.txt +5 -2
  3. taxonomy-terms-order.php +1 -1
include/addons.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
 
3
  //Co-Authors Plus fix
4
- add_action ('to/get_terms_orderby/ignore', 'to__get_terms_orderby__ignore', 10, 3);
5
- function to__get_terms_orderby__ignore( $ignore, $orderby, $args )
6
  {
7
  if( !function_exists('is_plugin_active') )
8
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
@@ -16,6 +16,35 @@
16
  return TRUE;
17
 
18
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
 
21
  ?>
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 )
6
  {
7
  if( !function_exists('is_plugin_active') )
8
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
16
  return TRUE;
17
 
18
  }
19
+
20
+
21
+ //WooCommerce Attribute order
22
+ add_action ('to/get_terms_orderby/ignore', 'to_get_terms_orderby_ignore_woocommerce', 10, 3);
23
+ function to_get_terms_orderby_ignore_woocommerce( $ignore, $orderby, $args )
24
+ {
25
+ if( !function_exists('is_plugin_active') )
26
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
27
+
28
+ if( ! is_plugin_active( 'woocommerce/woocommerce.php' ))
29
+ return $ignore;
30
+
31
+ //create a list of attribute taxonomies
32
+ $attributes = wc_get_attribute_taxonomies();
33
+ $found_attributex_tax = array();
34
+ foreach ( $attributes as $attribute )
35
+ {
36
+ $found_attributex_tax[] = 'pa_' . $attribute->attribute_name;
37
+ }
38
+
39
+ if ( ! isset($args['taxonomy']) || count($args['taxonomy']) !== 1 )
40
+ return $ignore;
41
+
42
+ if ( count ( array_intersect( $found_attributex_tax, $args['taxonomy']) ) < 1 )
43
+ return $ignore;
44
+
45
+ return TRUE;
46
+
47
+ }
48
 
49
 
50
  ?>
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.2
7
- Stable tag: 1.5.6
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,9 @@ Consider upgrading to our advanced version of this plugin at a very resonable pr
59
 
60
  == Change Log ==
61
 
 
 
 
62
  = 1.5.6 =
63
  - Rely on 'terms_clauses' filter than 'get_terms_orderby' as producing issues with the $maybe_orderby_meta backward compatibility.
64
  - Fix WooCommerce category order apply
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.2.1
7
+ Stable tag: 1.5.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 =
63
+ - Ignore WooCOmmerce Attributes order as being changed through default interface
64
+
65
  = 1.5.6 =
66
  - Rely on 'terms_clauses' filter than 'get_terms_orderby' as producing issues with the $maybe_orderby_meta backward compatibility.
67
  - Fix WooCommerce category order apply
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.6
7
  Author: Nsp-Code
8
  Author URI: http://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
  Author: Nsp-Code
8
  Author URI: http://www.nsp-code.com
9
  Author Email: electronice_delphi@yahoo.com