Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Freshness Linked


_ck_
Participant

@_ck_

“get_topic_last_post_link()” and it’s dependency “get_post_link()” relies on two important things which can be easily thrown off in bbpress or it’s db

1. if you are using a plugin or other code to change the number of topics shown on the front page or forum pages vs the topic page, get_topic_last_post_link() will calculate the last post incorrectly. This is because there is only one universal setting in bbpress right now for the number of items per page (there should be an array in the core so limit can be different than limit and then get_topic_last_post_link() will know to look at the destination limit instead of where it’s coming from)

see my bug fix for custom limits for each page here:

https://bbpress.org/forums/topic/custom-topics-count-for-different-pages-that-doesnt-break-last-post

it basically forces get_post_link to recalculate

2. get_topic_last_post_link() relies on the post_position in the bbpress table – which can get messed up if there are deleted posts, moved/merged posts, or recounts

Recounts does not attempt to recalculate and resave the post_position. This would have to be written. It basically would have to look at all posts in a topic, sort them by the desired date order, and then renumber them.

Skip to toolbar