Skip to:
Content

bbPress.org

Changeset 7351


Ignore:
Timestamp:
10/17/2025 02:29:43 PM (2 months ago)
Author:
johnjamesjacoby
Message:

Meta: pass post-type into relevant calls to register_meta().

This change ensures that these bbPress meta keys are not associated with other custom post-types, particularly when using the REST API.

Props r-a-y, terresquall.

See #3588.

Fixes #3436.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bbpress.php

    r7340 r7351  
    777777        /** Post **************************************************************/
    778778
    779         // Counts
     779        // Forum
     780        $count['object_subtype'] = bbp_get_forum_post_type();
    780781        register_meta( 'post', '_bbp_topic_count',           $count );
    781782        register_meta( 'post', '_bbp_reply_count',           $count );
    782783        register_meta( 'post', '_bbp_total_topic_count',     $count );
    783784        register_meta( 'post', '_bbp_total_reply_count',     $count );
    784         register_meta( 'post', '_bbp_voice_count',           $count );
    785         register_meta( 'post', '_bbp_anonymous_reply_count', $count );
    786785        register_meta( 'post', '_bbp_topic_count_hidden',    $count );
    787786        register_meta( 'post', '_bbp_reply_count_hidden',    $count );
    788787        register_meta( 'post', '_bbp_forum_subforum_count',  $count );
    789788
     789        // Topic
     790        $count['object_subtype'] = bbp_get_topic_post_type();
     791        register_meta( 'post', '_bbp_reply_count',           $count );
     792        register_meta( 'post', '_bbp_voice_count',           $count );
     793        register_meta( 'post', '_bbp_anonymous_reply_count', $count );
     794        register_meta( 'post', '_bbp_reply_count_hidden',    $count );
     795
    790796        /* User ***************************************************************/
    791797
    792798        // Counts
     799        $count['object_subtype'] = '';
    793800        register_meta( 'user', '_bbp_topic_count', $count );
    794801        register_meta( 'user', '_bbp_reply_count', $count );
Note: See TracChangeset for help on using the changeset viewer.