Detect if DIVI Builder is Running

Last updated 10 months ago

PHP
/**
* Check for DIVI Builder.
*/
function hlabs_enqueue_non_visual_builder_scripts() {
	if (empty($_GET['et_fb'])) {
		wp_enqueue_script('my-script', site_url('/test.js'));
	}
}
add_action('wp_enqueue_scripts', 'hlabs_enqueue_non_visual_builder_scripts');

Check for Divi in jQuery.

JavaScript
<script>
jQuery(function() {
	if (!$("body").hasClass('et_fb')) {
		// Do something.
	}	
});
</script>

All code snippets are licensed GPLv2 or later unless otherwise stated.