#4928 closed defect (bug) (fixed)
Function that adds 'buddypress" to body tag is too greedy
Reported by: | dcavins | Owned by: | |
---|---|---|---|
Milestone: | 1.7.1 | Priority: | normal |
Severity: | minor | Version: | 1.7 |
Component: | Templates | Keywords: | |
Cc: |
Description
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
I don't think the body is meant to have the BuddyPress class on non-BP pages