Opened 14 months ago
Last modified 14 months ago
#3578 new defect (bug)
`$topic_author` may be incorrect after the 'bbp_new_topic_pre_insert' filter
Reported by: | dd32 | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | minor | Version: | |
Component: | API - Actions/Filters | Keywords: | |
Cc: |
Description (last modified by )
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.