Making WordPress.org

Changeset 4291


Ignore:
Timestamp:
10/25/2016 09:11:46 PM (10 years ago)
Author:
coffee2code
Message:

Support Forums, User Badges: Add 'author-has-badge' class to generically indicate that author was assigned any badge.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-user-badges/inc/class-plugin.php

    r4269 r4291  
    183183         */
    184184        protected function get_badge_class( $classes, $item_type, $item_id ) {
     185                $has_badge = false;
     186
    185187                // Class related to moderators.
    186188                if ( $this->is_user_moderator() ) {
    187189                        $classes[] = 'by-moderator';
     190                        $has_badge = true;
    188191                }
    189192
     
    200203                        if ( $contrib_type ) {
    201204                                $classes[] = 'by-' . $info['type'] . '-' . $contrib_type;
    202                         }
     205                                $has_badge = true;
     206                        }
     207                }
     208
     209                if ( $has_badge ) {
     210                        $classes[] = 'author-has-badge';
    203211                }
    204212
Note: See TracChangeset for help on using the changeset viewer.