Changeset 6382
- Timestamp:
- 10/03/2012 06:57:37 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs/bp-blogs-template.php
r6380 r6382 358 358 359 359 return apply_filters( 'bp_get_blog_description', $blogs_template->blog->description ); 360 } 361 362 363 /** 364 * Output the row class of a site 365 * 366 * @since BuddyPress (1.7) 367 */ 368 function bp_blog_class() { 369 echo bp_get_blog_class(); 370 } 371 /** 372 * Return the row class of a site 373 * 374 * @global BP_Blogs_Template $blogs_template 375 * @return string Row class of the site 376 * @since BuddyPress (1.7) 377 */ 378 function bp_get_blog_class() { 379 global $blogs_template; 380 381 $classes = array(); 382 $pos_in_loop = (int) $blogs_template->current_blog; 383 384 // If we've only one site in the loop, don't bother with odd and even. 385 if ( $blogs_template->blog_count > 1 ) 386 $classes[] = ( $pos_in_loop % 2 ) ? 'even' : 'odd'; 387 else 388 $classes[] = 'bp-single-blog'; 389 390 $classes = apply_filters( 'bp_get_blog_class', $classes ); 391 $classes = array_merge( $classes, array() ); 392 393 $retval = 'class="' . join( ' ', $classes ) . '"'; 394 return $retval; 360 395 } 361 396
Note: See TracChangeset
for help on using the changeset viewer.