🔥 HOT: Changeset/ - Uncensored 2025

Skip to:

Changeset 14175


Ignore:
Timestamp:
12/26/2025 07:53:17 PM (3 days 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)

Location:
trunk/src/bp-templates
Files:
2 edited

Legend:

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

    r14068 r14175  
    8585        add_action( 'bp_enqueue_community_scripts', array( $this, 'localize_scripts' ) ); // Enqueue theme script localization
    8686
    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         }
     87        // Body no-js class.
     88        add_filter( 'body_class', array( $this, 'add_nojs_body_class' ), 20, 1 );
    9289
    9390        /** Buttons ***********************************************************/
     
    477474     * @since 1.7.0
    478475     *
    479      * @param array $classes Array of classes to append to body tag.
    480      * @return array $classes
     476     * @param string[] $classes Array of classes to append to body tag.
     477     * @return string[]
    481478     */
    482479    public function add_nojs_body_class( $classes ) {
    483         if ( ! in_array( 'no-js', $classes ) )
    484             $classes[] = 'no-js';
     480        /** This filter is documented in bp-core/bp-core-dependency.php */
     481        if ( ! is_buddypress() || apply_filters( 'bp_enqueue_assets_in_bp_pages_only', true ) ) {
     482            return $classes;
     483        }
     484
     485        $classes[] = 'no-js';
    485486
    486487        return array_unique( $classes );
     
    494495     * @since 1.7.0
    495496     */
    496     public function localize_scripts() {
    497     }
     497    public function localize_scripts() {}
    498498
    499499    /**
  • 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.