Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/26/2022 02:59:36 PM (3 years 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-legacy/buddypress-functions.php

    r13294 r13306  
    8181        /** Scripts ***********************************************************/
    8282
    83         add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_styles'   ) ); // Enqueue theme CSS
    84         add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_scripts'  ) ); // Enqueue theme JS
    85         add_filter( 'bp_enqueue_scripts', array( $this, 'localize_scripts' ) ); // Enqueue theme script localization
     83        add_action( 'bp_enqueue_community_scripts', array( $this, 'enqueue_styles'   ) ); // Enqueue theme CSS
     84        add_action( 'bp_enqueue_community_scripts', array( $this, 'enqueue_scripts'  ) ); // Enqueue theme JS
     85        add_action( 'bp_enqueue_community_scripts', array( $this, 'localize_scripts' ) ); // Enqueue theme script localization
    8686
    8787        /** Body no-js Class **************************************************/
Note: See TracChangeset for help on using the changeset viewer.