Reorder Posts - Version 2.0.2

Version Description

  • Released 2014-12-26
  • Bug fix: Saving admin panel settings resulted in a variety of PHP offset error messages.
  • Bug fix: Querying multiple post types resulted in PHP illegal offset error messages.
Download this release

Release Info

Developer ronalfy
Plugin Icon 128x128 Reorder Posts
Version 2.0.2
Comparing to
See all releases

Code changes from version 2.0.1 to 2.0.2

Files changed (3) hide show
  1. class-reorder-admin.php +7 -7
  2. index.php +1 -1
  3. readme.txt +10 -1
class-reorder-admin.php CHANGED
@@ -276,7 +276,7 @@ class MN_Reorder_Admin {
276
  //Typically set on post type archives or custom WP_Query or get_posts instances
277
  $post_type = $main_query[ 'post_type' ];
278
  }
279
- if ( !$post_type ) return;
280
 
281
  //See if suppress filters is on (using get_posts) (if it's not, use modify_menu_order_sql for that)
282
  if ( !isset( $main_query[ 'suppress_filters' ] ) ) return;
@@ -320,7 +320,7 @@ class MN_Reorder_Admin {
320
  } elseif ( is_home() ) {
321
  $post_type = 'post';
322
  }
323
- if ( !$post_type ) return $sql_orderby;
324
 
325
  if ( !apply_filters( 'metronet_reorder_allow_menu_order_' . $post_type, true ) ) return $sql_orderby; //Return false to disable this for each individual post type as opposed to using a global filter above
326
 
@@ -399,14 +399,14 @@ class MN_Reorder_Admin {
399
  $menu_order = $input[ 'menu_order' ];
400
  if ( !empty( $menu_order ) ) {
401
  foreach( $post_types as $post_type_name => &$values ) {
402
- $orderby = isset( $values[ 'orderby' ] ) ? $values[ 'orderby' ] : 'none';
403
  if ( $orderby !== 'menu_order' ) {
404
- $values[ 'orderby' ] == 'none';
405
  }
406
 
407
- $order = isset( $values[ 'order' ] ) ? $values[ 'order' ] : 'DESC';
408
  if ( $orderby !== 'ASC' ) {
409
- $values[ 'order' ] == 'DESC';
410
  }
411
  }
412
  $input[ 'menu_order' ] = $menu_order;
@@ -420,4 +420,4 @@ class MN_Reorder_Admin {
420
  add_action( 'init', 'mn_reorder_admin_instantiate', 15 );
421
  function mn_reorder_admin_instantiate() {
422
  MN_Reorder_Admin::get_instance();
423
- }
276
  //Typically set on post type archives or custom WP_Query or get_posts instances
277
  $post_type = $main_query[ 'post_type' ];
278
  }
279
+ if ( !$post_type || is_array( $post_type ) ) return;
280
 
281
  //See if suppress filters is on (using get_posts) (if it's not, use modify_menu_order_sql for that)
282
  if ( !isset( $main_query[ 'suppress_filters' ] ) ) return;
320
  } elseif ( is_home() ) {
321
  $post_type = 'post';
322
  }
323
+ if ( !$post_type || is_array( $post_type ) ) return $sql_orderby;
324
 
325
  if ( !apply_filters( 'metronet_reorder_allow_menu_order_' . $post_type, true ) ) return $sql_orderby; //Return false to disable this for each individual post type as opposed to using a global filter above
326
 
399
  $menu_order = $input[ 'menu_order' ];
400
  if ( !empty( $menu_order ) ) {
401
  foreach( $post_types as $post_type_name => &$values ) {
402
+ $orderby = isset( $menu_order[ $post_type_name ][ 'orderby' ] ) ? $menu_order[ $post_type_name ] : 'none';
403
  if ( $orderby !== 'menu_order' ) {
404
+ $menu_order[ $post_type_name ][ 'orderby' ] == 'none';
405
  }
406
 
407
+ $order = isset( $menu_order[ $post_type_name ][ 'order' ] ) ? $menu_order[ $post_type_name ] : 'DESC';
408
  if ( $orderby !== 'ASC' ) {
409
+ $menu_order[ $post_type_name ][ 'order' ] == 'DESC';
410
  }
411
  }
412
  $input[ 'menu_order' ] = $menu_order;
420
  add_action( 'init', 'mn_reorder_admin_instantiate', 15 );
421
  function mn_reorder_admin_instantiate() {
422
  MN_Reorder_Admin::get_instance();
423
+ }
index.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Metronet Reorder Posts
4
  Plugin URI: https://wordpress.org/plugins/metronet-reorder-posts/
5
  Description: Reorder posts
6
- Version: 2.0.1
7
  Author: Ryan Hellyer, Ronald Huereca, Scott Basgaard
8
  Author URI: https://github.com/ronalfy/reorder-posts
9
  Text Domain: metronet-reorder-posts
3
  Plugin Name: Metronet Reorder Posts
4
  Plugin URI: https://wordpress.org/plugins/metronet-reorder-posts/
5
  Description: Reorder posts
6
+ Version: 2.0.2
7
  Author: Ryan Hellyer, Ronald Huereca, Scott Basgaard
8
  Author URI: https://github.com/ronalfy/reorder-posts
9
  Text Domain: metronet-reorder-posts
readme.txt CHANGED
@@ -5,7 +5,7 @@ Plugin URL: https://wordpress.org/plugins/metronet-reorder-posts/
5
  Requires at Least: 3.7
6
  Tested up to: 4.1
7
  Tags: reorder, re-order, posts, wordpress, post-type, ajax, admin, hierarchical, menu_order, ordering
8
- Stable tag: 2.0.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -106,7 +106,13 @@ This plugin requires WordPress 3.7 or above. We urge you, however, to always us
106
 
107
  == Changelog ==
108
 
 
 
 
 
 
109
  = 2.0.1 =
 
110
  * Altered contributor documentation.
111
  * Adding filters for determining where the Reorder sub-menu will show up.
112
  * Sub-menu headings now reflect the post type that is being re-ordered.
@@ -155,6 +161,9 @@ This plugin requires WordPress 3.7 or above. We urge you, however, to always us
155
 
156
  == Upgrade Notice ==
157
 
 
 
 
158
  = 2.0.1 =
159
  Filter additions, and several bug fixes.
160
 
5
  Requires at Least: 3.7
6
  Tested up to: 4.1
7
  Tags: reorder, re-order, posts, wordpress, post-type, ajax, admin, hierarchical, menu_order, ordering
8
+ Stable tag: 2.0.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
106
 
107
  == Changelog ==
108
 
109
+ = 2.0.2 =
110
+ * Released 2014-12-26
111
+ * Bug fix: Saving admin panel settings resulted in a variety of PHP offset error messages.
112
+ * Bug fix: Querying multiple post types resulted in PHP illegal offset error messages.
113
+
114
  = 2.0.1 =
115
+ * Released 2014-12-23
116
  * Altered contributor documentation.
117
  * Adding filters for determining where the Reorder sub-menu will show up.
118
  * Sub-menu headings now reflect the post type that is being re-ordered.
161
 
162
  == Upgrade Notice ==
163
 
164
+ = 2.0.2 =
165
+ Bug fixes with PHP error notices. Highly recommend you upgrade.
166
+
167
  = 2.0.1 =
168
  Filter additions, and several bug fixes.
169