Skip to:
Content

bbPress.org

Opened 12 months ago

Last modified 12 months ago

#3578 new defect (bug)

`$topic_author` may be incorrect after the 'bbp_new_topic_pre_insert' filter

Reported by: dd32's profile dd32 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version:
Component: API - Actions/Filters Keywords:
Cc:

Description (last modified by dd32)

If you use the bbp_new_topic_pre_insert filter to change the authorship of a post (See https://meta.trac.wordpress.org/ticket/6839 for a use-case) the following bbp_new_topic hook will fire with the incorrect data passed.

This is because the hook uses the data from before the filter was run.

As a workaround, one can simply use bbp_get_topic_author_id( $topic_id ) instead of the passed $topic_author of the function.

Note: This applies equally to replies.

I've set the severity to minor, as although it's not ideal, this is not overly unexpected.

Change History (1)

#1 @dd32
12 months ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.