Opened 12 years ago
Closed 9 years ago
#24054 closed enhancement (wontfix)
(get_)comment_class() should include a is_user_member_of_blog() class
Reported by: | Viper007Bond | Owned by: | jeremyfelt |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.5.1 |
Component: | Comments | Keywords: | has-patch revert |
Focuses: | multisite | Cc: |
Description (last modified by )
On multi-site, there's no way to style comments that are members of the site. You can either style the post author or all registered users (who may not have access to the site's admin area). Example use case would be a multi-author site where you want comments from all authors highlighted.
I think it'd also be cool to include what role they are so that you could style say all authors, editors, and administrators but not style contributors or something like that.
I'm not sure if this would an information exposure issue though (does it matter if it is known what role a user is or that they are a member of the site?).
Attachments (4)
Change History (25)
#5
@
10 years ago
- Milestone changed from Awaiting Review to 4.2
Patch looks good. Hope we can get this into 4.2.
#6
@
10 years ago
- Focuses multisite added
I really like comment-author-is-site-member
as a built in class to help distinguish network users from site members.
I do think we should leave it up to the comment_class
filter to decide if role specific classes should be output as well. I could see not wanting that information displayed.
#7
@
10 years ago
- Owner set to jeremyfelt
- Resolution set to fixed
- Status changed from new to closed
In 31518:
#8
follow-up:
↓ 10
@
9 years ago
- Keywords 2nd-opinion added
- Resolution fixed deleted
- Status changed from closed to reopened
I just noticed this. Here are the current class names: byuser
, bypostauthor
, and now comment-author-is-site-member
. Finally, there's comment-author-$login
, which means this could hypothetically clash with comment-author
. Taken together, we should probably tweak this. I wouldn't mind something like bysiteuser
— it's ugly, but at least it is consistent.
I'm not actually sure we should have this. byuser
seems enough; a theme probably doesn't need to make a network vs site call all that often. Is it even a theme's call to make? Isn't this better for the comment class filter, and probably to actually hide byuser for non-site users? (Take for example a university where all faculty, staff, and students have an account; the president's blog would probably only have his staff show up as a user.)
#9
@
9 years ago
bysiteuser
is probably better. comment-author-is-site-member
is descriptive, but long and very different from existing classes.
I'm still in favor of the addition. There is no distinction between global/network user and site user, so this makes it possible (without filter) to highlight comment authors that are members of a site vs those happen to exist on the same network(s). That said, I don't currently have a use case for this, I can just imagine it coming up. It would be easy to implement the same thing via filter.
#10
in reply to:
↑ 8
;
follow-up:
↓ 13
@
9 years ago
I'm still of the opinion that we need a class to distinguish between global users and local users.
Replying to nacin:
Take for example a university where all faculty, staff, and students have an account; the president's blog would probably only have his staff show up as a user.
That seems really useful and pretty common for any multi-site setup. Why should a theme have to implement it's own functionality for this?
This ticket was mentioned in Slack in #core by drew. View the logs.
9 years ago
#12
@
9 years ago
- Keywords commit added; 2nd-opinion removed
24054.2.diff changes the new class name to bysiteuser
. I agree there's a valid use case.
#13
in reply to:
↑ 10
@
9 years ago
Replying to Viper007Bond:
That seems really useful and pretty common for any multi-site setup. Why should a theme have to implement it's own functionality for this?
Because the theme doesn't know whether they should be styling based on .byuser or .bysiteuser. It's probably not a decision a theme can or should make.
This ticket was mentioned in Slack in #core by helen. View the logs.
9 years ago
This ticket was mentioned in Slack in #core by helen. View the logs.
9 years ago
#17
@
9 years ago
- Keywords revert added; commit removed
Consensus from the above-linked scrub was to revert.
#18
@
9 years ago
In the context of public themes targeting these classes, I agree on a revert.
The use case I'm imagining is likely for networks using a common set of custom themes/plugins that could easily add the class in as needed.
Adds both "comment-author-is-site-member" and "comment-author-role-ROLE" classes