Post Types Order - Version 1.8.5

Version Description

  • Text domain change to post-types-order to allow translations at https://translate.wordpress.org/projects/wp-plugins/post-types-order
    • New query argument ignore_custom_sort , to be used with Autosort. Ignore any customised sort and return posts in default order.
Download this release

Release Info

Developer nsp-code
Plugin Icon 128x128 Post Types Order
Version 1.8.5
Comparing to
See all releases

Code changes from version 1.8.4 to 1.8.5

Files changed (2) hide show
  1. post-types-order.php +20 -6
  2. readme.txt +13 -4
post-types-order.php CHANGED
@@ -5,7 +5,9 @@ Plugin URI: http://www.nsp-code.com
5
  Description: Posts Order and Post Types Objects Order using a Drag and Drop Sortable javascript capability
6
  Author: Nsp Code
7
  Author URI: http://www.nsp-code.com
8
- Version: 1.8.4.1
 
 
9
  */
10
 
11
  define('CPTPATH', plugin_dir_path(__FILE__));
@@ -40,12 +42,20 @@ Version: 1.8.4.1
40
  { return $query; } // Stop running the function if this is a virtual page
41
  //--
42
 
43
- $options = cpt_get_options();
44
  if (is_admin())
45
- {
46
- //no need if it's admin interface
47
- return false;
48
- }
 
 
 
 
 
 
 
 
49
  //if auto sort
50
  if ($options['autosort'] == "1")
51
  {
@@ -69,6 +79,10 @@ Version: 1.8.4.1
69
 
70
  $options = cpt_get_options();
71
 
 
 
 
 
72
  //ignore the bbpress
73
  if (isset($query->query_vars['post_type']) && ((is_array($query->query_vars['post_type']) && in_array("reply", $query->query_vars['post_type'])) || ($query->query_vars['post_type'] == "reply")))
74
  return $orderBy;
5
  Description: Posts Order and Post Types Objects Order using a Drag and Drop Sortable javascript capability
6
  Author: Nsp Code
7
  Author URI: http://www.nsp-code.com
8
+ Version: 1.8.5
9
+ Text Domain: post-types-order
10
+ Domain Path: /languages/
11
  */
12
 
13
  define('CPTPATH', plugin_dir_path(__FILE__));
42
  { return $query; } // Stop running the function if this is a virtual page
43
  //--
44
 
45
+ //no need if it's admin interface
46
  if (is_admin())
47
+ return $query;
48
+
49
+ //check for ignore_custom_sort
50
+ if (isset($query->query_vars['ignore_custom_sort']) && $query->query_vars['ignore_custom_sort'] === TRUE)
51
+ return $query;
52
+
53
+ //ignore if "nav_menu_item"
54
+ if(isset($query->query_vars) && isset($query->query_vars['post_type']) && $query->query_vars['post_type'] == "nav_menu_item")
55
+ return $query;
56
+
57
+ $options = cpt_get_options();
58
+
59
  //if auto sort
60
  if ($options['autosort'] == "1")
61
  {
79
 
80
  $options = cpt_get_options();
81
 
82
+ //check for ignore_custom_sort
83
+ if (isset($query->query_vars['ignore_custom_sort']) && $query->query_vars['ignore_custom_sort'] === TRUE)
84
+ return $orderBy;
85
+
86
  //ignore the bbpress
87
  if (isset($query->query_vars['post_type']) && ((is_array($query->query_vars['post_type']) && in_array("reply", $query->query_vars['post_type'])) || ($query->query_vars['post_type'] == "reply")))
88
  return $orderBy;
readme.txt CHANGED
@@ -3,7 +3,8 @@ Contributors: Nsp Code
3
  Donate link: http://www.nsp-code.com/donate.php
4
  Tags: post order, posts order, sort, post sort, posts sort, post type order, custom order, admin posts order
5
  Requires at least: 2.8
6
- Tested up to: 4.3
 
7
 
8
  Post Order and custom Post Type Objects (posts, any custom post types) using a Drag and Drop Sortable JavaScript AJAX interface.
9
 
@@ -67,14 +68,22 @@ There's a option you can trigger, to see the post types order as you defined in
67
 
68
  All ideas are welcome and i put them on my list to be implemented into the new versions. Anyway this may take time, but if you are in a rush, please consider a small donation and we can arrange something.
69
 
 
 
 
 
 
70
  == Change Log ==
71
 
 
 
 
 
72
  = 1.8.4.1 =
73
  - Sortable interface styling improvments
74
  - Portuguese translation update - Pedro Mendonca - http://www.pedromendonca.pt
75
  - Text doamin fix for few texts
76
- - Text domain change to post-types-order
77
-
78
  = 1.8.3.1 =
79
  - Advanced Custom Fields Page Rule fix
80
  - Show / Hide Re_order inderface for certain menus. Option available within Settings area.
@@ -86,7 +95,7 @@ All ideas are welcome and i put them on my list to be implemented into the new v
86
 
87
  = 1.8.1 =
88
  - Next / Previous sorting apply bug fix for custom taxonomies
89
- - Portuguese translation update - Pedro Mendon�a - http://www.pedromendonca.pt
90
  - Options - phrase translation fix
91
 
92
  = 1.7.9 =
3
  Donate link: http://www.nsp-code.com/donate.php
4
  Tags: post order, posts order, sort, post sort, posts sort, post type order, custom order, admin posts order
5
  Requires at least: 2.8
6
+ Tested up to: 4.4
7
+ Stable tag: 1.8.5
8
 
9
  Post Order and custom Post Type Objects (posts, any custom post types) using a Drag and Drop Sortable JavaScript AJAX interface.
10
 
68
 
69
  All ideas are welcome and i put them on my list to be implemented into the new versions. Anyway this may take time, but if you are in a rush, please consider a small donation and we can arrange something.
70
 
71
+ = Can i make certain queries to ignore the custom sort when Autosort is turned On? =
72
+
73
+ This can be doe by including the ignore_custom_sort within custom query arguments. An example can be found at http://www.nsp-code.com/advanced-post-types-order-api/sample-usage/
74
+
75
+
76
  == Change Log ==
77
 
78
+ = 1.8.5 =
79
+ - Text domain change to post-types-order to allow translations at https://translate.wordpress.org/projects/wp-plugins/post-types-order
80
+ - New query argument ignore_custom_sort , to be used with Autosort. Ignore any customised sort and return posts in default order.
81
+
82
  = 1.8.4.1 =
83
  - Sortable interface styling improvments
84
  - Portuguese translation update - Pedro Mendonca - http://www.pedromendonca.pt
85
  - Text doamin fix for few texts
86
+
 
87
  = 1.8.3.1 =
88
  - Advanced Custom Fields Page Rule fix
89
  - Show / Hide Re_order inderface for certain menus. Option available within Settings area.
95
 
96
  = 1.8.1 =
97
  - Next / Previous sorting apply bug fix for custom taxonomies
98
+ - Portuguese translation update - Pedro Mendonca - http://www.pedromendonca.pt
99
  - Options - phrase translation fix
100
 
101
  = 1.7.9 =