funkhaus / fuxt-backend

A theme that turns WordPress into a true Headless CMS. Optimized for the fuxt frontend boilerplate and fuxt-api plugin.
GNU General Public License v3.0
101 stars 19 forks source link

Fix 44 #45

Closed rsm0128 closed 1 year ago

rsm0128 commented 1 year ago

Fix #44

rsm0128 commented 1 year ago

@drewbaker By default, inSameParent is true for hierarchical and false for non-hierarchical post types.

drewbaker commented 1 year ago

I'm very nervous about the use of $wpdb in this... There is a lot of code here and will be hard to maintain this. I get the need to avoid getting all siblings to figure out what's next, and the performance issues of that, but in reality over years of using this code, it worked fine actually.

I think I'd rather just re-write this to have a get_adjacent_page() and get_adjacent_post() function that was much simpler and mapped to wp_query() args...

Let me think about this some more before we continue.

drewbaker commented 1 year ago

Closing as I did this using a more simplified approach in a new PR.

https://github.com/funkhaus/fuxt-backend/pull/51