Skip to:
Content

bbPress.org

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#3128 closed enhancement (fixed)

Filter the array of non-public statuses in bbp_update_topic_reply_count_hidden()

Reported by: SergeyBiryukov Owned by: johnjamesjacoby
Milestone: 2.6 Priority: normal
Severity: normal Version:
Component: Component - Topics Keywords: commit
Cc:

Description

In bbp_update_topic_reply_count_hidden(), the list of non-public statuses is limited to three existing statuses: trash, spam, pending.

WordPress.org forums have an archived status, added in #meta1963 as a way to hide posts from public view while keeping them for future reference (e.g. to check the history of a particular user). "Trash" was not suitable for that, as trashed posts are auto-deleted after 30 days. "Pending" was not suitable either, as already reviewed posts should not be moved back to moderation queue.

bbp_update_topic_reply_count_hidden() should have a filter on $statuses to allow for specifying additional non-public statuses.

Change History (6)

#1 @SergeyBiryukov
2 years ago

At a glance, the following functions would benefit from a similar change:

  • bbp_get_all_child_ids()
  • bbp_update_forum_topic_count_hidden()
  • bbp_admin_repair_topic_hidden_reply_count()

I guess there should be a filterable bbp_get_hidden_statuses() function that could be used in all of those instances.

#2 @johnjamesjacoby
2 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 2.6
  • Owner set to johnjamesjacoby

#3 @johnjamesjacoby
2 years ago

In 6643:

Query: use NOT IN strategy in bbp_get_all_child_ids()

This ensures that only specific post-statuses are explicitly excluded from "all child IDs" type queries, where previously post-statuses needed to be specifically defined.

See #3128.

#4 @johnjamesjacoby
2 years ago

In 6644:

Topics: Introduce bbp_get_non_public_topic_statuses()

This new function returns the inverse post-statuses of bbp_get_public_topic_statuses() with a filter to help target them more specifically in places where it was not previously possible to do so.

See #3128.

#5 @johnjamesjacoby
2 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Looks done. Closing as fixed.

#6 @johnjamesjacoby
2 years ago

In 6685:

Query: use NOT IN strategy in bbp_get_all_child_ids()

This ensures that only specific post-statuses are explicitly excluded from "all child IDs" type queries, where previously post-statuses needed to be specifically defined.

See #3128. Fixes #3140. 2.5 branch, for 2.5.14.

Note: See TracTickets for help on using tickets.