Simple Page Ordering - Version 2.4.1

Version Description

  • 2022-06-21 =
  • Added: Missing text domain to strings (props @kebbet, @dkotter, @jeffpaul via #92.
  • Fixed: Condition in REST page sorting logic in rest_page_ordering method (props @szepeviktor, @iamdharmesh via #94.
  • Fixed: PHP Coding standards (props @szepeviktor, @dinhtungdu via #93.
  • Changed: Bump WordPress "tested up to" version to 6.0 (props @peterwilsoncc, @vikrampm1, @Sidsector9, @jeffpaul via #95, #98.
  • Security: Bump grunt from 1.5.2 to 1.5.3 (props @dependabot via #99.
Download this release

Release Info

Developer 10up
Plugin Icon 128x128 Simple Page Ordering
Version 2.4.1
Comparing to
See all releases

Code changes from version 2.4.0 to 2.4.1

Files changed (3) hide show
  1. .phpcs.xml.dist +0 -4
  2. readme.txt +9 -2
  3. simple-page-ordering.php +11 -11
.phpcs.xml.dist DELETED
@@ -1,4 +0,0 @@
1
- <?xml version="1.0"?>
2
- <ruleset name="Project Rules">
3
- <rule ref="10up-Default" />
4
- </ruleset>
 
 
 
 
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Simple Page Ordering ===
2
- Contributors: 10up, jakemgold, welcher, helen, thinkoomph
3
  Donate link: http://10up.com/plugins/simple-page-ordering-wordpress/
4
  Tags: order, re-order, ordering, pages, page, manage, menu_order, hierarchical, ajax, drag-and-drop, admin
5
  Requires at least: 3.8
6
  Tested up to: 6.0
7
- Stable tag: 2.4.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -94,6 +94,13 @@ add_filter( 'simple_page_ordering_is_sortable', function( $sortable, $post_type
94
 
95
  == Changelog ==
96
 
 
 
 
 
 
 
 
97
  = 2.4.0 - 2022-04-28 =
98
  * **Added:** REST API for reordering posts: `/wp-json/simplepageordering/v1/` (props [@rmccue](https://profiles.wordpress.org/rmccue/), [@ciprianimike](https://github.com/ciprianimike), [@cadic](https://profiles.wordpress.org/cadic/), [@lkraav](https://github.com/lkraav), [@dinhtungdu](https://github.com/dinhtungdu)).
99
  * **Added:** [REST Endpoint Documentation](https://github.com/10up/simple-page-ordering/blob/develop/README.md).
1
  === Simple Page Ordering ===
2
+ Contributors: 10up, jakemgold, welcher, helen, thinkoomph, jeffpaul
3
  Donate link: http://10up.com/plugins/simple-page-ordering-wordpress/
4
  Tags: order, re-order, ordering, pages, page, manage, menu_order, hierarchical, ajax, drag-and-drop, admin
5
  Requires at least: 3.8
6
  Tested up to: 6.0
7
+ Stable tag: 2.4.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
94
 
95
  == Changelog ==
96
 
97
+ = 2.4.1 - 2022-06-21 =
98
+ * **Added:** Missing text domain to strings (props [@kebbet](https://github.com/kebbet), [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul) via [#92](https://github.com/10up/simple-page-ordering/pull/92).
99
+ * **Fixed:** Condition in REST page sorting logic in `rest_page_ordering` method (props [@szepeviktor](https://github.com/szepeviktor), [@iamdharmesh](https://github.com/iamdharmesh) via [#94](https://github.com/10up/simple-page-ordering/pull/94).
100
+ * **Fixed:** PHP Coding standards (props [@szepeviktor](https://github.com/szepeviktor), [@dinhtungdu](https://github.com/dinhtungdu) via [#93](https://github.com/10up/simple-page-ordering/pull/93).
101
+ * **Changed:** Bump WordPress "tested up to" version to 6.0 (props [@peterwilsoncc](https://github.com/peterwilsoncc), [@vikrampm1](https://github.com/vikrampm1), [@Sidsector9](https://github.com/Sidsector9), [@jeffpaul](https://github.com/jeffpaul) via [#95](https://github.com/10up/simple-page-ordering/pull/95), [#98](https://github.com/10up/simple-page-ordering/pull/98).
102
+ * **Security:** Bump `grunt` from 1.5.2 to 1.5.3 (props [@dependabot](https://github.com/apps/dependabot) via [#99](https://github.com/10up/simple-page-ordering/pull/99).
103
+
104
  = 2.4.0 - 2022-04-28 =
105
  * **Added:** REST API for reordering posts: `/wp-json/simplepageordering/v1/` (props [@rmccue](https://profiles.wordpress.org/rmccue/), [@ciprianimike](https://github.com/ciprianimike), [@cadic](https://profiles.wordpress.org/cadic/), [@lkraav](https://github.com/lkraav), [@dinhtungdu](https://github.com/dinhtungdu)).
106
  * **Added:** [REST Endpoint Documentation](https://github.com/10up/simple-page-ordering/blob/develop/README.md).
simple-page-ordering.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Simple Page Ordering
4
  * Plugin URI: http://10up.com/plugins/simple-page-ordering-wordpress/
5
  * Description: Order your pages and hierarchical post types using drag and drop on the built in page list. For further instructions, open the "Help" tab on the Pages screen.
6
- * Version: 2.4.0
7
  * Requires at least: 3.8
8
  * Author: Jake Goldman, 10up
9
  * Author URI: https://10up.com
@@ -27,7 +27,7 @@ if ( ! class_exists( 'Simple_Page_Ordering' ) ) :
27
  /**
28
  * Handles initializing this class and returning the singleton instance after it's been cached.
29
  *
30
- * @return null|Simple_page_Ordering
31
  */
32
  public static function get_instance() {
33
  // Store the instance locally to avoid private static replication
@@ -186,7 +186,7 @@ if ( ! class_exists( 'Simple_Page_Ordering' ) ) :
186
  * @param int $start The start index.
187
  * @param array $excluded Array of post IDs.
188
  *
189
- * @return obj|WP_Error
190
  */
191
  public static function page_ordering( $post_id, $previd, $nextid, $start, $excluded ) {
192
  // real post?
@@ -366,7 +366,7 @@ if ( ! class_exists( 'Simple_Page_Ordering' ) ) :
366
  );
367
 
368
  if ( $children->have_posts() ) {
369
- return( 'children' );
370
  }
371
  }
372
 
@@ -421,29 +421,29 @@ if ( ! class_exists( 'Simple_Page_Ordering' ) ) :
421
  'permission_callback' => '__return_true',
422
  'args' => [
423
  'id' => [
424
- 'description' => 'Post ID.',
425
  'required' => true,
426
  'type' => 'numeric',
427
  ],
428
  'previd' => [
429
- 'description' => 'Previous post ID',
430
  'required' => true,
431
  'type' => 'numeric',
432
  ],
433
  'nextid' => [
434
- 'description' => 'Next post ID',
435
  'required' => true,
436
  'type' => 'numeric',
437
  ],
438
  'start' => [
439
  'default' => 1,
440
- 'description' => 'Start index',
441
  'required' => false,
442
  'type' => 'numeric',
443
  ],
444
  'exclude' => [
445
  'default' => [],
446
- 'description' => 'Array of excluded post IDs',
447
  'required' => false,
448
  'type' => 'array',
449
  ],
@@ -464,8 +464,8 @@ if ( ! class_exists( 'Simple_Page_Ordering' ) ) :
464
  $start = empty( $request->get_param( 'start' ) ) ? 1 : (int) $request->get_param( 'start' );
465
  $excluded = empty( $request->get_param( 'excluded' ) ) ? array( $request->get_param( 'id' ) ) : array_filter( (array) json_decode( $request->get_param( 'excluded' ) ), 'intval' );
466
 
467
- // check and make sure we have what we need
468
- if ( empty( $post_id ) || ( ! isset( $previd ) && ! isset( $nextid ) ) ) {
469
  return new WP_Error( __( 'Missing mandatory parameters.', 'simple-page-ordering' ) );
470
  }
471
 
3
  * Plugin Name: Simple Page Ordering
4
  * Plugin URI: http://10up.com/plugins/simple-page-ordering-wordpress/
5
  * Description: Order your pages and hierarchical post types using drag and drop on the built in page list. For further instructions, open the "Help" tab on the Pages screen.
6
+ * Version: 2.4.1
7
  * Requires at least: 3.8
8
  * Author: Jake Goldman, 10up
9
  * Author URI: https://10up.com
27
  /**
28
  * Handles initializing this class and returning the singleton instance after it's been cached.
29
  *
30
+ * @return null|Simple_Page_Ordering
31
  */
32
  public static function get_instance() {
33
  // Store the instance locally to avoid private static replication
186
  * @param int $start The start index.
187
  * @param array $excluded Array of post IDs.
188
  *
189
+ * @return object|WP_Error|"children"
190
  */
191
  public static function page_ordering( $post_id, $previd, $nextid, $start, $excluded ) {
192
  // real post?
366
  );
367
 
368
  if ( $children->have_posts() ) {
369
+ return 'children';
370
  }
371
  }
372
 
421
  'permission_callback' => '__return_true',
422
  'args' => [
423
  'id' => [
424
+ 'description' => __( 'Post ID.', 'simple-page-ordering' ),
425
  'required' => true,
426
  'type' => 'numeric',
427
  ],
428
  'previd' => [
429
+ 'description' => __( 'Previous post ID', 'simple-page-ordering' ),
430
  'required' => true,
431
  'type' => 'numeric',
432
  ],
433
  'nextid' => [
434
+ 'description' => __( 'Next post ID', 'simple-page-ordering' ),
435
  'required' => true,
436
  'type' => 'numeric',
437
  ],
438
  'start' => [
439
  'default' => 1,
440
+ 'description' => __( 'Start index', 'simple-page-ordering' ),
441
  'required' => false,
442
  'type' => 'numeric',
443
  ],
444
  'exclude' => [
445
  'default' => [],
446
+ 'description' => __( 'Array of excluded post IDs', 'simple-page-ordering' ),
447
  'required' => false,
448
  'type' => 'array',
449
  ],
464
  $start = empty( $request->get_param( 'start' ) ) ? 1 : (int) $request->get_param( 'start' );
465
  $excluded = empty( $request->get_param( 'excluded' ) ) ? array( $request->get_param( 'id' ) ) : array_filter( (array) json_decode( $request->get_param( 'excluded' ) ), 'intval' );
466
 
467
+ // Check and make sure we have what we need.
468
+ if ( false === $post_id || ( false === $previd && false === $nextid ) ) {
469
  return new WP_Error( __( 'Missing mandatory parameters.', 'simple-page-ordering' ) );
470
  }
471