Skip to:

Opened 3 years ago

Last modified 3 months ago

#3436 new defect (bug)

register_meta() calls should use 'object_subtype' argument

Reported by: r-a-y's profile r-a-y Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 2.6.0
Component: API Keywords: has-patch


bbPress registers various meta keys, but doesn't set the 'object_subtype' argument:

Currently, this means any post that is published will receive the following meta keys regardless of bbPress post type:

  • _bbp_topic_count
  • _bbp_reply_count
  • _bbp_total_topic_count
  • _bbp_total_reply_count
  • _bbp_voice_count
  • _bbp_anonymous_reply_count
  • _bbp_topic_count_hidden
  • _bbp_reply_count_hidden
  • _bbp_forum_subforum_count

I've attached a patch that only registers meta keys for the correct bbPress forum and topic post types.

Attachments (2)

3436.01.patch (1.3 KB) - added by r-a-y 3 years ago.
3436.02.patch (1.7 KB) - added by r-a-y 3 years ago.

Download all attachments as: .zip

Change History (5)

3 years ago

#1 @r-a-y
3 years ago

Could also use register_post_meta() in place of register_meta() instead.

Ignore 01.patch, use 02.patch.

Last edited 3 years ago by r-a-y (previous) (diff)

3 years ago

#2 @hasanuzzamanshamim
3 years ago

  • Keywords has-patch added

#3 @r-a-y
8 months ago

#3588 was marked as a duplicate.

Note: See TracTickets for help on using tickets.