Skip to:
Content

Changeset 11208


Ignore:
Timestamp:
10/24/16 19:56:47 (15 months ago)
Author:
hnla
Message:

Add group & member types to body class array

Commit loops the Member types & Group types to add them to the bp_get_the_body_class() function for single groups & bp_user screens.

Fixes #7301 Props hnla, offereins

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-template.php

    r11198 r11208  
    32993299        if ( bp_is_user() ) { 
    33003300            $bp_classes[] = 'bp-user'; 
     3301 
     3302            // Add current user member types. 
     3303            if ( $member_types = bp_get_member_type( bp_displayed_user_id(), false ) ) { 
     3304                foreach( $member_types as $member_type ) { 
     3305                    $bp_classes[] = sprintf( 'member-type-%s', esc_attr( $member_type ) ); 
     3306                } 
     3307            } 
    33013308        } 
    33023309 
     
    33893396        if ( bp_is_group() ) { 
    33903397            $bp_classes[] = 'group-' . groups_get_current_group()->slug; 
     3398 
     3399            // Add current group types. 
     3400            if ( $group_types = bp_groups_get_group_type( bp_get_current_group_id(), false ) ) { 
     3401                foreach ( $group_types as $group_type ) { 
     3402                    $bp_classes[] = sprintf( 'group-type-%s', esc_attr( $group_type ) ); 
     3403                } 
     3404            } 
    33913405        } 
    33923406 
Note: See TracChangeset for help on using the changeset viewer.