Created
November 7, 2019 10:29
-
-
Save alanef/4b849ac6914a4527f7e04b40c940d0af to your computer and use it in GitHub Desktop.
Disable WP BAkery on WooCommerce Shop page
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 | |
| /** | |
| * Must use plugin that deactivates WP Bakery on the shop page only | |
| */ | |
| // Don't allow direct execution | |
| if ( ! defined( 'WPINC' ) ) { | |
| die; | |
| } | |
| $request_uri = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH ); | |
| add_filter( 'option_active_plugins', function ( $plugins ) use ( $request_uri ) { | |
| if ( false === strpos( $request_uri, '/shop/' ) ) { | |
| return $plugins; | |
| } | |
| if ( false !== ( $i = array_search( "js_composer/js_composer.php", $plugins ) ) ) { | |
| unset( $plugins[ $i ] ); | |
| } | |
| return $plugins; | |
| } ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment