/** * Registers and enqueues stylesheets for the administration panel and the * public facing site. * * Example: * self::enqueue_shared_file('SCRIPT-ID', INBOUNDNOW_SHARED_PATH . 'assets/js/frontend/path-in-shared-assets.js', 'localized_var_name', $localized_array_values, $dependancies_array ); */ static function register_scripts_and_styles() { /* Frontent and Backend Files */ /* Conditionals for admin or frontend */ if (is_admin()) { /*self::enqueue_shared_file('inbound-analytics', 'assets/js/frontend/analytics/inboundAnalytics.js', array( 'jquery' ), 'inbound_settings', self::localize_lead_data()); */ self::enqueue_shared_file('jquery-cookie', 'assets/js/global/jquery.cookie.js', array('jquery')); self::enqueue_shared_file('jquery-total-storage', 'assets/js/global/jquery.total-storage.min.js', array('jquery')); $inbound_now_screens = Inbound_Compatibility::return_inbound_now_screens(); /* list of inbound now screens */ $screen = get_current_screen(); /* Target Specific screen with echo $screen->id; */ if ($screen->id == 'wp-call-to-action') { self::enqueue_shared_file('image-picker-js', 'assets/js/admin/image-picker.js'); self::enqueue_shared_file('image-picker-css', 'assets/css/admin/image-picker.css'); } } else { global $wp_scripts; $store = false; if (!empty($wp_scripts->queue)) { $store = $wp_scripts->queue; /* store the scripts */ foreach ($wp_scripts->queue as $handle) { wp_dequeue_script($handle); } } /* unminified source available */ self::enqueue_shared_file('inbound-analytics', 'assets/js/frontend/analytics/inboundAnalytics.min.js', array('jquery'), 'inbound_settings', self::localize_lead_data()); if (is_array($store)) { foreach ($store as $handle) { wp_enqueue_script($handle); } } } }
/** * Registers and enqueues stylesheets for the administration panel and the * public facing site. * * Example: * self::load_file('SCRIPT-ID', 'frontend/js/path-in-shared-assets.js', 'localized_var_name', $localized_array_values, $dependancies_array ); */ static function register_scripts_and_styles() { /* Frontent and Backend Files */ self::load_file('jquery-cookie', 'global/js/jquery.cookie.js', array('jquery')); self::load_file('jquery-total-storage', 'global/js/jquery.total-storage.min.js', array('jquery')); if (is_user_logged_in()) { self::load_file('inbound-admin', 'admin/css/global-inbound-admin.css'); } /* Conditionals for admin or frontend */ if (is_admin()) { $inbound_now_screens = Inbound_Compatibility::return_inbound_now_screens(); // list of inbound now screens $screen = get_current_screen(); /* Target Specific screen with // echo $screen->id; */ if ($screen->id == 'wp-call-to-action') { self::load_file('image-picker-js', 'admin/js/image-picker.js'); self::load_file('image-picker-css', 'admin/css/image-picker.css'); } /* Metabox CSS */ self::load_file('inbound-metaboxes', 'admin/css/inbound-metaboxes.css'); //self::load_file('script-test', 'admin/js/test.js'); } else { global $wp_scripts; if (!empty($wp_scripts->queue)) { $store = $wp_scripts->queue; // store the scripts foreach ($wp_scripts->queue as $handle) { wp_dequeue_script($handle); } } /*if (!defined('InboundAnalytics_v2')) { self::load_file('funnel-tracking', 'frontend/js/inbound.js', array( 'jquery','jquery-cookie', 'jquery-total-storage'), 'wplft', self::localize_lead_data()); self::load_file('store-lead-ajax', 'frontend/js/store.lead.ajax.js', array( 'jquery','jquery-cookie', 'jquery-total-storage'), 'inbound_ajax', self::localize_lead_data()); } else { */ self::load_file('funnel-tracking', 'frontend/js/analytics/inboundAnalytics.js', array('jquery'), 'inbound_settings', self::localize_lead_data()); /* } */ if (is_array($store)) { foreach ($store as $handle) { wp_enqueue_script($handle); } } /* Target Specific post type with if ( is_singular( 'landing-page' ) ) { } */ //self::load_file('test-css', 'frontend/css/test.css'); } }
function inbound_turn_on_compatiblity() { $screen = get_current_screen(); // Add all Plugin Screens to Array $inbound_screens = Inbound_Compatibility::return_inbound_now_screens(); // grabs our plugin screen ids // If Not Inbound Now Screen Exit function if (!in_array($screen->id, $inbound_screens)) { return; } $lead_compatiblity = get_option('wpl-main-inbound_compatibility_mode', $default = false); $cta_compatiblity = get_option('wp-cta-main-inbound_compatibility_mode', $default = false); $lp_compatiblity = get_option('lp-main-inbound_compatibility_mode', $default = false); if ($lead_compatiblity || $cta_compatiblity || $lp_compatiblity) { Inbound_Compatibility::inbound_compatibilities_mode(); // kill third party scripts } }