Skip to:
Content

BuddyPress.org

Changeset 8068


Ignore:
Timestamp:
03/06/2014 07:50:21 PM (9 years ago)
Author:
djpaul
Message:

Core: merge custom body classes with WordPress' defaults.

Until 1.9, we overrode all the custom body classes that are added to the theme, and replaced them with BuddyPress-specific classes.
With 1.9 in r7663, we manually added a couple of WordPress core classes back to fix compatibility problems with certain themes (notably, Twenty Fourteen). However, body classes added by other plugins were still removed.

This change merges BuddyPress' body classes into those provided by WordPress core, and those from any other plugins.

Fixes #4929 and #5204

File:
1 edited

Legend:

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

    r7960 r8068  
    23482348            $bp_classes[] = 'groups-activity';
    23492349
    2350         if ( is_user_logged_in() )
    2351             $bp_classes[] = 'logged-in';
    2352 
    23532350        /** Messages **********************************************************/
    23542351
     
    24222419        }
    24232420
    2424         /** is_buddypress *****************************************************/
     2421        /** Clean up ***********************************************************/
    24252422
    24262423        // Add BuddyPress class if we are within a BuddyPress page
     
    24292426        }
    24302427
    2431         /** Clean up***********************************************************/
    2432 
    2433         // We don't want WordPress blog classes to appear on non-blog pages.
    2434         if ( !bp_is_blog_page() ) {
    2435 
    2436             // Observe WP custom background body class
    2437             if ( in_array( 'custom-background', (array) $wp_classes ) )
    2438                 $bp_classes[] = 'custom-background';
    2439 
    2440             // Observe WP admin bar body classes
    2441             if ( in_array( 'admin-bar', (array) $wp_classes ) )
    2442                 $bp_classes[] = 'admin-bar';
    2443             if ( in_array( 'no-customize-support', (array) $wp_classes ) )
    2444                 $bp_classes[] = 'no-customize-support';
    2445 
    2446             // Preserve any custom classes already set
    2447             if ( !empty( $custom_classes ) ) {
    2448                 $wp_classes = (array) $custom_classes;
    2449             } else {
    2450                 $wp_classes = array();
    2451             }
    2452         }
    2453 
    2454         // Merge WP classes with BP classes and remove any duplicates
     2428        // Merge WP classes with BuddyPress classes and remove any duplicates
    24552429        $classes = array_unique( array_merge( (array) $bp_classes, (array) $wp_classes ) );
    24562430
Note: See TracChangeset for help on using the changeset viewer.