bbPress
Are you looking for a timeless, elegant, and streamlined discussion board? bbPress is easy to integrate, easy to use, and is built to scale with your growing community. bbPress is intentionally simple yet infinitely powerful forum software, built by contributors to WordPress. Developer Notes Count u
Are you looking for a timeless, elegant, and streamlined discussion board? bbPress is easy to integrate, easy to use, and is built to scale with your growing community.
bbPress is intentionally simple yet infinitely powerful forum software, built by contributors to WordPress.
Developer Notes
Count updates in 2.6.17
bbPress now synchronizes its built-in public and hidden topic and reply counts, aggregate forum counts, and user contribution counts on bbp_transition_post_status at priority 10, after WordPress persists the new post status. When a topic crosses the public status boundary, its stored public reply count is applied to the forum aggregate instead of recounting every reply. The action receives the new status, old status, and WP_Post object. The bbp_pre_update_counts_on_transition_post_status filter can short-circuit the complete topic or reply count operation for custom status lifecycles or count storage.
The existing bbp_new_* , bbp_insert_* , bbp_trash_* , bbp_untrash_* , bbp_spam_* , bbp_unspam_* , bbp_approve_* , and bbp_unapprove_* topic and reply actions continue to fire with their existing arguments and timing. Their corresponding completed actions, such as bbp_trashed_* , also remain available. The public count helper functions also remain callable.
For topic and reply creation, the status transition occurs inside wp_insert_post() . The later bbp_new_* and bbp_insert_* actions therefore continue to run after status counts are updated and after bbPress stores its relationship metadata. Creation-specific integrations can remain on those actions.
For moderation, status-count synchronization occurs between the existing pre-transition action, such as bbp_spam_reply , and its completed action, such as bbp_spammed_reply . Extensions that need every persisted topic, reply, forum, and user status-count change should use bbp_transition_post_status at priority 11 or later. Completed moderation actions begin after those counts are finalized.
bbPress no longer attaches its built-in topic, reply, forum, and user status-count callbacks to the creation and moderation actions. Manually firing one of those actions without changing the post status therefore no longer updates those counts. Topic voice counts and engagements remain attached to the creation and completed moderation actions, so manually firing one of those actions can still recalculate voices and engagements without a status change. The priority-11 transition hook does not observe those later updates. Extensions that need both recalculations to finish can use priority 31 or later on the legacy action; bbPress runs engagement callbacks before voice-count callbacks. Count membership comes from the filtered public and non-public status arrays. Extensions that already maintain counts for custom statuses should remove duplicate count callbacks and keep the public and non-public arrays disjoint. The public increase and decrease convenience functions now validate the current topic or reply status; use the lower-level bump functions for an intentional numeric difference. Do not manually fire bbp_transition_post_status to simulate a write because its count callback trusts the supplied statuses as a completed database transition.