Changeset 6366
- Timestamp:
- 09/30/2012 10:44:15 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/bp-groups/bp-groups-template.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-template.php
r6342 r6366 383 383 384 384 return apply_filters( 'bp_get_group_id', $group->id ); 385 } 386 387 /** 388 * Output the row class of a group 389 * 390 * @since BuddyPress (1.7) 391 */ 392 function bp_group_class() { 393 echo bp_get_group_class(); 394 } 395 /** 396 * Return the row class of a group 397 * 398 * @global BP_Groups_Template $groups_template 399 * @return string Row class of the group 400 * @since BuddyPress (1.7) 401 */ 402 function bp_get_group_class() { 403 global $groups_template; 404 405 $classes = array(); 406 $pos_in_loop = (int) $groups_template->current_group; 407 408 // If we've only one group in the loop, don't both with odd and even. 409 if ( $groups_template->group_count > 1 ) 410 $classes[] = ( $pos_in_loop % 2 ) ? 'even' : 'odd'; 411 else 412 $classes[] = 'bp-single-group'; 413 414 // Group type - public, private, hidden. 415 $classes[] = esc_attr( $groups_template->group->status ); 416 417 // User's group status 418 if ( bp_is_user_active() ) { 419 if ( bp_group_is_admin() ) 420 $classes[] = 'is-admin'; 421 422 if ( bp_group_is_member() ) 423 $classes[] = 'is-member'; 424 425 if ( bp_group_is_mod() ) 426 $classes[] = 'is-mod'; 427 } 428 429 $classes = apply_filters( 'bp_get_group_class', $classes ); 430 $classes = array_merge( $classes, array() ); 431 $retval = 'class="' . join( ' ', $classes ) . '"'; 432 433 return $retval; 385 434 } 386 435
Note: See TracChangeset
for help on using the changeset viewer.