Skip to:
Content

bbPress.org

Changeset 7467 for trunk/src/bbpress.php


Ignore:
Timestamp:
09/10/2026 12:35:43 AM (12 days ago)
Author:
johnjamesjacoby
Message:

Counts: synchronize metadata across concurrent writes.

Introduce bbp_bump_count_meta() to update existing numeric metadata with bounded compare-and-swap retries while preserving WordPress metadata filters, actions, sanitization, and cache invalidation. Apply atomic differences to forum, topic, reply, ancestor, and user contribution counts.

Reconcile counts, engagements, and voices across status transitions, permanent deletion, author changes and reassignment, moderator move/merge/split operations, and repair recounts. Correct recursive forum totals and reply visibility, and preserve term-backed favorites and subscriptions during engagement rebuilds.

Document the count-hook compatibility changes and new helper arguments, and add regression coverage for single-site and multisite workflows.

In trunk, for 2.7.

Props alex-ye.
Fixes #2233.
Fixes #3678.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bbpress.php

    r7445 r7467  
    863863                // Forum
    864864                $count['object_subtype'] = bbp_get_forum_post_type();
    865                 register_meta( 'post', '_bbp_topic_count',           $count );
    866                 register_meta( 'post', '_bbp_reply_count',           $count );
    867                 register_meta( 'post', '_bbp_total_topic_count',     $count );
    868                 register_meta( 'post', '_bbp_total_reply_count',     $count );
    869                 register_meta( 'post', '_bbp_topic_count_hidden',    $count );
    870                 register_meta( 'post', '_bbp_reply_count_hidden',    $count );
    871                 register_meta( 'post', '_bbp_forum_subforum_count',  $count );
     865                register_meta( 'post', '_bbp_topic_count',              $count );
     866                register_meta( 'post', '_bbp_reply_count',              $count );
     867                register_meta( 'post', '_bbp_total_topic_count',        $count );
     868                register_meta( 'post', '_bbp_total_reply_count',        $count );
     869                register_meta( 'post', '_bbp_topic_count_hidden',       $count );
     870                register_meta( 'post', '_bbp_reply_count_hidden',       $count );
     871                register_meta( 'post', '_bbp_total_topic_count_hidden', $count );
     872                register_meta( 'post', '_bbp_total_reply_count_hidden', $count );
     873                register_meta( 'post', '_bbp_forum_subforum_count',     $count );
    872874
    873875                // Topic
Note: See TracChangeset for help on using the changeset viewer.