Skip to:
Content

bbPress.org


Ignore:
Timestamp:
11/19/2021 04:04:05 PM (3 years ago)
Author:
johnjamesjacoby
Message:

Appearance: only add no-js body class on bbPress pages.

This change addresses a regression introduced in r7190, causing the bbpress body class to unintentionally be added to all pages triggering layout issues in some WordPress themes.

This commit makes sure that the bbpress body class is only added when intended, and moves the no-js body class into the same conditional check.

In trunk for 2.7. See #3443.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/common/template.php

    r7212 r7220  
    966966 * @return array Body Classes
    967967 */
    968 function bbp_body_class( $wp_classes, $custom_classes = false ) {
    969 
    970     // Default classes
    971     $bbp_classes = array( 'no-js' );
     968function bbp_body_class( $wp_classes = array(), $custom_classes = false ) {
     969
     970    // Default to no classes
     971    $bbp_classes = array();
    972972
    973973    /** Archives **************************************************************/
     
    10781078    }
    10791079
    1080     /** Clean up **************************************************************/
    1081 
    1082     // Add bbPress class if we are within a bbPress page
     1080    /** General ***************************************************************/
     1081
     1082    // Any page with bbPress content
    10831083    if ( ! empty( $bbp_classes ) ) {
    10841084        $bbp_classes[] = 'bbpress';
    1085     }
     1085        $bbp_classes[] = 'no-js';
     1086    }
     1087
     1088    /** Clean up **************************************************************/
    10861089
    10871090    // Merge WP classes with bbPress classes and remove any duplicates
Note: See TracChangeset for help on using the changeset viewer.