Opened 8 years ago
Closed 8 years ago
#2988 closed defect (bug) (fixed)
Protect all calls to bbp_is_user_forum_moderator() with a bbp_allow_forum_mods() check
Reported by: | jmdodd | Owned by: | johnjamesjacoby |
---|---|---|---|
Milestone: | 2.6 | Priority: | normal |
Severity: | normal | Version: | trunk |
Component: | API - Roles/Capabilities | Keywords: | has-patch needs-refresh |
Cc: |
Description
bbp_is_user_forum_moderator() ultimately uses get_posts() to check if a forum has a postmeta for a given user id. When bbp_allow_forum_mods() is false, this check is unnecessary and results in multiple queries for the same information.
One query in includes/replies/capabilities.php already has this check; it is absent from topics and forums capabilities.
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
Let's handle this inside of
bbp_is_user_forum_moderator()
so all usages benefit from this improvement.Fix incoming. Thanks for finding & suggesting this improvement.