Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/26/2025 07:53:17 PM (6 months ago)
Author:
espellcaste
Message:

Restore no-js body class for BuddyPress pages.

Regression introduced at [13672], part of [13418].

Props r-a-y and vapvarun.

See #8679
Fixes #9304 (trunk)

File:
1 edited

Legend:

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

    r14068 r14175  
    228228        remove_action( 'bp_enqueue_community_scripts', 'bp_core_confirmation_js' );
    229229
    230         /** This filter is documented in bp-core/bp-core-dependency.php */
    231         if ( is_buddypress() || ! apply_filters( 'bp_enqueue_assets_in_bp_pages_only', true ) ) {
    232             // Body no-js class.
    233             add_filter( 'body_class', array( $this, 'add_nojs_body_class' ), 20, 1 );
    234         }
     230        // Body no-js class.
     231        add_filter( 'body_class', array( $this, 'add_nojs_body_class' ), 20, 1 );
    235232
    236233        // Ajax querystring.
     
    484481     * @since 3.0.0
    485482     *
    486      * @param array $classes Array of classes to append to body tag.
    487      *
    488      * @return array $classes
     483     * @param string[] $classes Array of classes to append to body tag.
     484     * @return string[]
    489485     */
    490486    public function add_nojs_body_class( $classes ) {
     487        /** This filter is documented in bp-core/bp-core-dependency.php */
     488        if ( ! is_buddypress() || apply_filters( 'bp_enqueue_assets_in_bp_pages_only', true ) ) {
     489            return $classes;
     490        }
     491
    491492        $classes[] = 'no-js';
     493
    492494        return array_unique( $classes );
    493495    }
Note: See TracChangeset for help on using the changeset viewer.