Forked from DanielBakovic/conditional_bbpress_style.php
Created
February 3, 2020 16:55
-
-
Save toluaddy/6da021edf54510f325ac595accd0c31a to your computer and use it in GitHub Desktop.
Conditional loadinf of bbPress CSS/JavaScripts
This file contains hidden or 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 | |
| function conditional_bbpress_styles_scripts() { | |
| // First check that bbpress exists to prevent fatal errors | |
| if ( function_exists( 'is_bbpress' ) ) { | |
| //dequeue scripts and styles | |
| if ( ! is_bbpress() && ! is_buddypress() ) { | |
| wp_dequeue_style('bbp-default'); | |
| wp_dequeue_style( 'bbp_private_replies_style'); | |
| wp_dequeue_script('bbpress-editor'); | |
| } | |
| } | |
| } | |
| add_action( 'wp_enqueue_scripts', 'conditional_bbpress_styles_scripts', 99 ); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment