Quick and dirty fix for upfront light box issues

Many of your out there might be running a multi-site network and have a light box or other gallery plugin that is network activated.

Upfront / Panino contains a lightbox and built in gallery plugin with the theme.

A problem that occurs is that the lightbox for images loads twice, so I needed to create a plugin that disables the lightbox script for my gallery plugin when the upfront theme is loaded and when NOT on a post type of the my gallery plugin. The gallery plugin i have network activated is Fancy Gallery, and this is the plugin I wrote to solve the problem:

<?PHP
/*
Plugin Name: Upfront Gallery Compatibility
Plugin URI: http://www.mywebsite.com
Version: v 1.0
Author: Ben M
Description: This will check for the upfront parent theme, check if it is NOT on a fancy-gallery page type, and if both conditions are met it will de-register the javascript file causing two pop-ups.
*/
function wp_upfront_dequeue_problem_script() {
        if( wp_get_theme()->parent_theme == 'Upfront') {
                if(get_post_type( get_the_ID() ) != 'fancy-gallery') {
                        wp_deregister_script( 'fancy-gallery' );
                }
        }
}
add_action( 'wp_print_scripts', 'wp_upfront_dequeue_problem_script', 100 );

This is free to use, enjoy.