Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/16/2023 10:48:45 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
Fixes #9033 (branch 12.0)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/12.0/src/bp-templates/bp-nouveau/buddypress-functions.php

    r13652 r13673  
    221221                remove_action( 'bp_enqueue_community_scripts', 'bp_core_confirmation_js' );
    222222
    223                 // Body no-js class.
    224                 add_filter( 'body_class', array( $this, 'add_nojs_body_class' ), 20, 1 );
     223                /** This filter is documented in bp-core/bp-core-dependency.php */
     224                if ( is_buddypress() || ! apply_filters( 'bp_enqueue_assets_in_bp_pages_only', true ) ) {
     225                        // Body no-js class.
     226                        add_filter( 'body_class', array( $this, 'add_nojs_body_class' ), 20, 1 );
     227                }
    225228
    226229                // Ajax querystring.
Note: See TracChangeset for help on using the changeset viewer.