Opened 10 years ago
Closed 10 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 |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.6 |
| Component: | API - Roles/Capabilities | Version: | trunk |
| Severity: | normal | 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.