[wp-meta] [Making WordPress.org] #2590: Enhance compatibility with per forum moderators
Making WordPress.org
noreply at wordpress.org
Sat Mar 18 19:04:06 UTC 2017
#2590: Enhance compatibility with per forum moderators
----------------------------+------------------
Reporter: ocean90 | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: Support Forums | Resolution:
Keywords: has-patch |
----------------------------+------------------
Changes (by SergeyBiryukov):
* keywords: => has-patch
Comment:
> In `User_Badges\Plugin::is_user_moderator()` using
`get_queried_object_id()` seems to work.
It doesn't in moderator views, e.g. 'Archived'. `get_the_ID()` works
though.
On a related note, `bbp_get_reply_author_id()` should be replaced with
`get_post_field( 'post_author' )` there, since the function runs for both
topics and replies. `bbp_get_reply_author_id()` falls back to the
[https://bbpress.trac.wordpress.org/browser/tags/2.6-beta-2/src/includes/replies/template.php?marks=1089#L1075
same line] for topics (with `$reply_id = 0`), so this seems more
straightforward.
> Also affected: `Stickies_Compat` and user flagging in User_Moderation.
[attachment:2590.2.diff] handles some more affected instances in
`Moderators` class and `wporg-support` theme.
Not sure about user flagging though, I think only global moderators should
be able to flag users.
Note: The change in `wporg_support_add_moderation_notice()` (`wporg-
support/functions.php`) is unnecessary at the moment, since per-forum
moderators never see that notice:
* Spam/Pending/Archived views are only available to global moderators.
*
[https://bbpress.trac.wordpress.org/browser/tags/2.6-beta-2/src/includes/topics/template.php?marks=2215#L2197
bbp_get_topic_replies_link()] doesn't show `(+X hidden)`
link.[https://bbpress.trac.wordpress.org/browser/tags/2.6-beta-2/src/includes/replies/capabilities.php?marks=107#L100
'edit_others_replies' is mapped to 'moderate'], but the check doesn't
account for per-forum moderators.
*
[https://bbpress.trac.wordpress.org/browser/tags/2.6-beta-2/src/includes/common/functions.php?marks=298#L288
bbp_get_view_all()] doesn't account for per-forum moderators.
The latter two points seem worth fixing though, so I kept that change in
the patch.
--
Ticket URL: <https://meta.trac.wordpress.org/ticket/2590#comment:1>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org
More information about the wp-meta
mailing list