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, this issue will be resolved.
Closes #200
How to test the Change
Create a new post type
Create a parent and child post within this new post type
Verify debug warning does not get displayed
Changelog Entry
Fixed error in call to get_walked_pages for custom post types
Description of the Change
When reordering a custom post type, this
get_walked_pages
call fails with anundefined array key
error on line 433.Digging into it more, we can see that the
get_walked_pages
call is outputting only thetop_level_pages
for thepage
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 topost_type => 'page'
.If we tweak this to pass in the
post_type
of the post we're working with, in the same way we do withis_post_type_sortable
, this issue will be resolved.Closes #200
How to test the Change
Changelog Entry
Fixed error in call to get_walked_pages for custom post types
Credits
Props @zachgibb
Checklist: