Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/26/2022 02:59:36 PM (20 months ago)
Author:
imath
Message:

First step towards only loading Template Packs assets in BP pages

Avoid loading these assets everywhere inside the blog is a frequent request made by BuddyPress users. In 11.0.0 we are doing a first step into this direction by making available a new filter to restrict Template Packs assets loading to BuddyPress pages.

We encourage these users to simply add the add_filter( 'bp_enqueue_assets_in_bp_pages_only', '__return_true' ); code into a BP Custom file for instance to contribute to testing whether it has an unwanted side effect on the BuddyPress plugins that they might have activated.

This will help us feel more secure about completely restricting these assets to BP pages in a second step.

Props dcavins

Fixes #8679

File:
1 edited

Legend:

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

    r13189 r13306  
    179179        // Scripts & Styles.
    180180        $registration_params = array(
    181             'hook'     => 'bp_enqueue_scripts',
     181            'hook'     => 'bp_enqueue_community_scripts',
    182182            'priority' => 2,
    183183        );
     
    196196
    197197        // Enqueue theme CSS.
    198         add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_styles' ) );
     198        add_action( 'bp_enqueue_community_scripts', array( $this, 'enqueue_styles' ) );
    199199
    200200        // Enqueue theme JS.
    201         add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
     201        add_action( 'bp_enqueue_community_scripts', array( $this, 'enqueue_scripts' ) );
    202202
    203203        // Enqueue theme script localization.
    204         add_filter( 'bp_enqueue_scripts', array( $this, 'localize_scripts' ) );
    205         remove_action( 'bp_enqueue_scripts', 'bp_core_confirmation_js' );
     204        add_action( 'bp_enqueue_community_scripts', array( $this, 'localize_scripts' ) );
     205        remove_action( 'bp_enqueue_community_scripts', 'bp_core_confirmation_js' );
    206206
    207207        // Body no-js class.
Note: See TracChangeset for help on using the changeset viewer.