[buddypress-trac] [BuddyPress] #4928: Function that adds 'buddypress" to body tag is too greedy

buddypress-trac noreply at wordpress.org
Thu Apr 11 18:34:42 UTC 2013


#4928: Function that adds 'buddypress" to body tag is too greedy
-------------------------+-----------------------------
 Reporter:  dcavins      |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Core         |    Version:  1.7
 Severity:  minor        |   Keywords:
-------------------------+-----------------------------
 I've been adding the class buddypress to my themes manually via the
 functions.php file:

 {{{
 if ( function_exists( 'bp_is_blog_page' ) && !bp_is_blog_page() ) {
         $classes[] = 'buddypress';
       }
 }}}

 and it looks like similar functionality has been added to bp-core-template
 with 1.7. However, the new implementation sets 'buddypress' nearly all the
 time in my installation:


 {{{
 // Add BuddyPress class if we are within a BuddyPress page
                 if ( !empty( $bp_classes ) ) {
                         $bp_classes[] = 'buddypress';
                 }
 }}}

 There are a lot of false positives that populate $bp_classes, like being
 logged in or visiting the home page (even if you're not logged in).

 I definitely think adding 'buddypress' to the body class where appropriate
 is really helpful for theme developers.

 Thanks for all of the excellent work in 1.7.

 -David

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4928>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list