Info
- 3 posts
- 2 voices
- Started 2 years ago by Ashfame
- Latest reply from Ashfame
- This topic is not resolved
Style Keymaster's posts
-
- Posted 2 years ago #
Hello!
I want to have the ability to highlight posts of certain user levels like Keymasters and Moderators. I can see that no special CSS classes are added to their posts so the only way to accomplish it is by comparing the email ID but I was wondering if there is any easier / efficient way to do so?
-
- Posted 2 years ago #
This would be fairly straightforward to do via a plugin.
Sam recently modified a filter for a post class based on my suggestion in 1.0
http://trac.bbpress.org/ticket/1091
http://trac.bbpress.org/changeset/2093All you would have to do is hook the filter and examine the user for the post, then add a class based on role.
So the framework you need is something like this:
add_filter( 'post_del_class', 'post_class_by_role',10,2); function post_class_by_role($classes, $post_id ) { $post=bb_get_post($post_id); // do stuff here, add class to $classes if necessary return $classes; }This won't work in 0.9 however, you would need a template modification instead.
-
- Posted 2 years ago #
Yeah! I think I got it. Thanks _ck_ !
I will try it and get back if I need more help. :) -
You must log in to post.