#2845 closed enhancement (fixed)
Add unit tests for bbp_reply_position() and bbp_get_reply_url()
Reported by: | netweb | Owned by: | netweb |
---|---|---|---|
Milestone: | 2.6 | Priority: | normal |
Severity: | normal | Version: | 2.1 |
Component: | Component - Replies | Keywords: | has-patch |
Cc: |
Description
When adding add_filter( 'bbp_show_lead_topic', '__return_true' );
reply's positions are incorrect
Added in r3940:
// Bump the position by one if the lead topic is in the replies loop if ( ! bbp_show_lead_topic() ) $reply_position++;
It should only bump the reply position when bbp_show_lead_topic()
is true
, not false
or not defined
// Bump the position by one if the lead topic is in the replies loop if ( bbp_show_lead_topic() ) $reply_position++;
Attachments (1)
Change History (4)
#1
@
9 years ago
- Keywords 2nd-opinion removed
- Summary changed from Incorrect reply position when using bbp_show_lead_topic() to Add unit tests for bbp_reply_position() and bbp_get_reply_url()
- Type changed from defect to enhancement
Note: See
TracTickets for help on using
tickets.
A topics reply loop is paginated based on the
bbp_get_replies_per_page()
value:bbp_show_lead_topic()
reply positions are accurate per the storedmenu_order
of a repliy inwp-posts
, as such the topic is not included in the reply loop, each page will by default include 15 replies and the 1 topic.Note: Repurposing this ticket just for unit tests as there is nothing actually wrong in the code