Skip to:
Content

BuddyPress.org

Changeset 13673


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)

Location:
branches/12.0/src/bp-templates
Files:
2 edited

Legend:

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

    r13636 r13673  
    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 ***********************************************************/
  • 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.