Dequeue BB Magnific Popup lightbox

Hi,

I use a 3rd party lightbox plugin from dFactory and disabled BB lightbox in the customizer. It works with images in a text module (inserted with the text editor) but not with the photo module: 2 popups are overlapping when i click an image.

Actually, MFP is still loading from BB, i can see that in the page code (browser console):

<script type="text/javascript" src="https://mysite.fr/wp-content/plugins/bb-plugin/js/jquery.magnificpopup.min.js?ver=2.2.3"></script>

So i tried to dequeue MFP using 2 different methods, none works, the script is still loading in the page.

Method 1:

add_action( 'wp_enqueue_scripts', function() {
    wp_dequeue_style( 'jquery-magnificpopup' );
    wp_dequeue_script( 'jquery-magnificpopup' );
}, 9999 );

Method 2:

function wpdocs_dequeue_script() {
	wp_dequeue_style( 'jquery-magnificpopup' );
	wp_dequeue_script( 'jquery-magnificpopup' );
}
add_action( 'wp_print_scripts', 'wpdocs_dequeue_script', 9999 );

You should be able to use this filter. :slight_smile:

 add_filter( 'fl_builder_override_lightbox', '__return_true' );
1 Like

The filter works perfectly, i finally managed to get rid of this sticky lightbox. :slightly_smiling_face:
Thanks Danny!

1 Like