Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/16/2023 10:39:57 AM (3 years ago)
Author:
imath
Message:

BP Template packs: only add the no-js body class in community area

Since [13418] we do not load community assets by default everywhere on the site anymore.

But this commit appears to be incomplete: we also need to avoid adding the no-js body class when not in a community area.

NB: returning false to the 'bp_enqueue_assets_in_bp_pages_only' filter will carry on loading BP Template pack assets everywhere on the site.

Props sabernhardt, emaralive, shawfactor

See #8679
See #9033 (trunk)
Closes https://github.com/buddypress/buddypress/pull/201

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/buddypress-functions.php

    r13636 r13672  
    8585                add_action( 'bp_enqueue_community_scripts', array( $this, 'localize_scripts' ) ); // Enqueue theme script localization
    8686
    87                 /** Body no-js Class **************************************************/
    88 
    89                 add_filter( 'body_class', array( $this, 'add_nojs_body_class' ), 20, 1 );
     87                /** This filter is documented in bp-core/bp-core-dependency.php */
     88                if ( is_buddypress() || ! apply_filters( 'bp_enqueue_assets_in_bp_pages_only', true ) ) {
     89                        // Body no-js class.
     90                        add_filter( 'body_class', array( $this, 'add_nojs_body_class' ), 20, 1 );
     91                }
    9092
    9193                /** Buttons ***********************************************************/
Note: See TracChangeset for help on using the changeset viewer.