Skip to:
Content
Pages
Categories
Search
Top
Bottom

Style Keymaster's posts

  • @ashfame

    Participant

    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?

Viewing 2 replies - 1 through 2 (of 2 total)
  • @_ck_

    Participant

    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

    https://trac.bbpress.org/ticket/1091

    https://trac.bbpress.org/changeset/2093

    All 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.

    @ashfame

    Participant

    Yeah! I think I got it. Thanks _ck_ !

    I will try it and get back if I need more help. :)

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar