10up / simple-page-ordering

Order your pages and other hierarchical post types with simple drag and drop right from the standard page list.
https://wordpress.org/plugins/simple-page-ordering/
GNU General Public License v2.0
144 stars 22 forks source link

Add back the check for hierarchical post types, instead of just relying on `page-attributes` #108

Closed dkotter closed 1 year ago

dkotter commented 1 year ago

Description of the Change

In #103, we changed our sortable check to only rely on if a post type supports page-attributes. This broke sorting for sites that use post types that are hierarchical but don't have that attribute set. While it may better align with how core is set up to only look at page-attributes, it seems best to revert that change so we're not breaking functionality on sites that rely on the old behavior.

This isn't a complete revert of the changes introduced in #103 but does bring back the missing functionality.

How to test the Change

  1. Create a post type that has page-attributes set
  2. Add content to this post type
  3. Ensure you can sort this content and it reflects properly on the front-end
  4. Create a post type that doesn't have page-attributes set but is set as hierarchical
  5. Run through the same test steps and ensure things work

Changelog Entry

Changed - Allow hierarchical post types that don't have page-attributes set to be sorted.

Credits

Props @dkotter

Checklist: