Created
August 2, 2017 15:15
-
-
Save paulgibbs/8b45ec1edfa0dc724e7a0819896299f8 to your computer and use it in GitHub Desktop.
Remove bbPress script/style from non-bbPress pages.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Remove bbPress script/style from non-bbPress pages. | |
* | |
* @param \BBP_Theme_Compat $bbpress_theme bbPress' theme object. | |
*/ | |
add_action( 'bbp_theme_compat_actions', function( $bbpress_theme ) { | |
if ( is_bbpress() ) { | |
return; | |
} | |
remove_action( 'bbp_enqueue_scripts', array( $bbpress_theme, 'enqueue_styles' ) ); | |
remove_action( 'bbp_enqueue_scripts', array( $bbpress_theme, 'enqueue_scripts' ) ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment