Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update get_walked_pages to support custom post types Fixes 10up#200
When reordering a custom post type, this `get_walked_pages` call fails with an `undefined array key` error on line 433. Digging into it more, we can see that the `get_walked_pages` call is outputting only the `top_level_pages` for the `page` post type. This is due to the `get_pages` call on line 200 (https://github.com/10up/simple-page-ordering/blob/develop/class-simple-page-ordering.php#L200) defaulting to [`post_type => 'page'`](https://developer.wordpress.org/reference/functions/get_pages/#parameters). If we tweak this to pass in the `post_type` of the post we're working with, in the same way we do with [`is_post_type_sortable`](https://github.com/10up/simple-page-ordering/blob/develop/class-simple-page-ordering.php#L244), this issue will be resolved.
- Loading branch information