Last active
January 19, 2023 11:13
-
-
Save marklchaves/8556c81fa103946af1643158fc81e770 to your computer and use it in GitHub Desktop.
Disable Popup Maker if Using Divi Builder
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 // Ignore this first line when copying to your child theme's functions.php file. | |
/** | |
* Disable Popup Maker if Using Divi Builder | |
* | |
* Reference https://github.com/stefanoferrario/Extra/blob/e5eb5b20e6165ee989b8538f8eebbcddd24ce4b7/core/functions.php#L353 | |
*/ | |
add_action( 'wp', function() { | |
if ( ! function_exists( 'et_core_is_fb_enabled' ) ) return; | |
if ( et_core_is_fb_enabled() ) { | |
echo '<h4 style="position: absolute; z-index: 100000;">Divi Builder is enabled! Popup Maker is disabled.</h4>'; // Remove for production. | |
add_filter ( 'pum_popup_is_loadable', function($is_loadable) { | |
$is_loadable = false; | |
return $is_loadable; | |
} ); | |
} // if | |
} ); |
This is brilliant! Using the Divi Visual Builder was impossible if there was a pop-up defined for the page in question. This addresses exactly that issue. Many thanks!
Thanks, very useful!!
Thanks, very useful!!
Hey @brianshim, much appreciated 😌
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@marklchaves great stuff! Thanks for the code