Simple Custom Post Order - Version 2.4.5

Version Description

Download this release

Release Info

Developer machothemes
Plugin Icon wp plugin Simple Custom Post Order
Version 2.4.5
Comparing to
See all releases

Code changes from version 2.4.4 to 2.4.5

Files changed (3) hide show
  1. assets/scporder.js +8 -4
  2. readme.txt +7 -2
  3. simple-custom-post-order.php +13 -4
assets/scporder.js CHANGED
@@ -51,10 +51,14 @@
51
  });
52
 
53
  var y = 0;
54
- jQuery('#the-list').parent().find('thead').find('th').each(function () {
55
- $(this).width(td_array[y]);
56
- y += 1;
57
- });
 
 
 
 
58
  });
59
 
60
  /*****
51
  });
52
 
53
  var y = 0;
54
+ // check if there are no items in the table
55
+ if(jQuery('#the-list > tr.no-items').length == 0){
56
+ jQuery('#the-list').parent().find('thead').find('th').each(function () {
57
+ $(this).width(td_array[y]);
58
+ y += 1;
59
+ });
60
+ }
61
+
62
  });
63
 
64
  /*****
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: silkalns
3
  Tags: custom post order, post order, js post order, page order, posts order, category order, sort posts, sort pages, sort custom posts
4
  Requires at least: 4.6
5
  Requires PHP: 5.6
6
- Tested up to: 5.1
7
- Stable tag: 2.4.4
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -36,6 +36,11 @@ An answer to that question.
36
 
37
  == Changelog ==
38
 
 
 
 
 
 
39
  = Version 2.4.4 =
40
  * Fix for slow javscript in admin( https://github.com/ColorlibHQ/simple-custom-post-order/issues/46 )
41
  * Fix database error( https://github.com/ColorlibHQ/simple-custom-post-order/issues/36 )
3
  Tags: custom post order, post order, js post order, page order, posts order, category order, sort posts, sort pages, sort custom posts
4
  Requires at least: 4.6
5
  Requires PHP: 5.6
6
+ Tested up to: 5.2
7
+ Stable tag: 2.4.5
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
36
 
37
  == Changelog ==
38
 
39
+ = Version 2.4.5 =
40
+ * Added 2 action hooks that trigger at `update_menu_order_tags` and `update_menu_order` ( https://github
41
+ * Fix issue with sorting (https://github.com/ColorlibHQ/simple-custom-post-order/issues/49)
42
+ * Fix edit page layout when no item found
43
+
44
  = Version 2.4.4 =
45
  * Fix for slow javscript in admin( https://github.com/ColorlibHQ/simple-custom-post-order/issues/46 )
46
  * Fix database error( https://github.com/ColorlibHQ/simple-custom-post-order/issues/36 )
simple-custom-post-order.php CHANGED
@@ -3,10 +3,10 @@
3
  * Plugin Name: Simple Custom Post Order
4
  * Plugin URI: https://wordpress.org/plugins-wp/simple-custom-post-order/
5
  * Description: Order Items (Posts, Pages, and Custom Post Types) using a Drag and Drop Sortable JavaScript.
6
- * Version: 2.4.4
7
  * Author: Colorlib
8
  * Author URI: https://colorlib.com/
9
- * Tested up to: 5.1
10
  * Requires: 4.6 or higher
11
  * License: GPLv3 or later
12
  * License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -36,7 +36,7 @@
36
 
37
  define('SCPORDER_URL', plugins_url('', __FILE__));
38
  define('SCPORDER_DIR', plugin_dir_path(__FILE__));
39
- define('SCPORDER_VERSION', '2.4.4');
40
 
41
  $scporder = new SCPO_Engine();
42
 
@@ -298,6 +298,8 @@ class SCPO_Engine {
298
  $wpdb->update($wpdb->posts, array('menu_order' => $menu_order_arr[$position]), array('ID' => intval($id)));
299
  }
300
  }
 
 
301
  }
302
 
303
  public function update_menu_order_tags() {
@@ -329,6 +331,8 @@ class SCPO_Engine {
329
  $wpdb->update($wpdb->terms, array('term_order' => $menu_order_arr[$position]), array('term_id' => intval($id)));
330
  }
331
  }
 
 
332
  }
333
 
334
  public function update_options() {
@@ -512,7 +516,12 @@ class SCPO_Engine {
512
  if (!isset($args['taxonomy']))
513
  return $orderby;
514
 
515
- $taxonomy = $args['taxonomy'];
 
 
 
 
 
516
  if (!in_array($taxonomy, $tags))
517
  return $orderby;
518
 
3
  * Plugin Name: Simple Custom Post Order
4
  * Plugin URI: https://wordpress.org/plugins-wp/simple-custom-post-order/
5
  * Description: Order Items (Posts, Pages, and Custom Post Types) using a Drag and Drop Sortable JavaScript.
6
+ * Version: 2.4.5
7
  * Author: Colorlib
8
  * Author URI: https://colorlib.com/
9
+ * Tested up to: 5.2
10
  * Requires: 4.6 or higher
11
  * License: GPLv3 or later
12
  * License URI: http://www.gnu.org/licenses/gpl-3.0.html
36
 
37
  define('SCPORDER_URL', plugins_url('', __FILE__));
38
  define('SCPORDER_DIR', plugin_dir_path(__FILE__));
39
+ define('SCPORDER_VERSION', '2.4.5');
40
 
41
  $scporder = new SCPO_Engine();
42
 
298
  $wpdb->update($wpdb->posts, array('menu_order' => $menu_order_arr[$position]), array('ID' => intval($id)));
299
  }
300
  }
301
+
302
+ do_action('scp_update_menu_order');
303
  }
304
 
305
  public function update_menu_order_tags() {
331
  $wpdb->update($wpdb->terms, array('term_order' => $menu_order_arr[$position]), array('term_id' => intval($id)));
332
  }
333
  }
334
+
335
+ do_action('scp_update_menu_order_tags');
336
  }
337
 
338
  public function update_options() {
516
  if (!isset($args['taxonomy']))
517
  return $orderby;
518
 
519
+ if(is_array($args['taxonomy'])){
520
+ $taxonomy = $args['taxonomy'][0];
521
+ } else {
522
+ $taxonomy = $args['taxonomy'];
523
+ }
524
+
525
  if (!in_array($taxonomy, $tags))
526
  return $orderby;
527