function TS_VCSC_Extensions_Front_Main() { global $post; $url = plugin_dir_url(__FILE__); require_once $this->assets_dir . 'ts_vcsc_registrations_files.php'; // Check For Standard Frontend Page if (!is_404() && !is_search() && !is_archive()) { $TS_VCSC_StandardFrontendPage = "true"; } else { $TS_VCSC_StandardFrontendPage = "false"; } // Load Scripts As Needed if (!empty($post)) { if (($this->TS_VCSC_LoadFrontEndLightbox == "true" || get_option('ts_vcsc_extend_settings_lightboxIntegration', 0) == 1) && $TS_VCSC_StandardFrontendPage == "true" && $this->TS_VCSC_UseInternalLightbox == "true" && $this->TS_VCSC_VCFrontEditMode == "false") { wp_enqueue_script('ts-extend-hammer'); wp_enqueue_script('ts-extend-nacho'); wp_enqueue_style('ts-extend-nacho'); } if ($this->TS_VCSC_LoadFrontEndTooltips == "true" && $TS_VCSC_StandardFrontendPage == "true" && $this->TS_VCSC_VCFrontEditMode == "false") { wp_enqueue_style('ts-extend-simptip'); wp_enqueue_style('ts-extend-tooltipster'); wp_enqueue_script('ts-extend-tooltipster'); } if (get_option('ts_vcsc_extend_settings_loadFonts', 0) == 1) { // Add CSS for each enabled Font to WordPress Admin BackEnd foreach ($this->TS_VCSC_Installed_Icon_Fonts as $Icon_Font => $iconfont) { if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, 0) == 1 && get_option('ts_vcsc_extend_settings_load' . $iconfont, 0) == 1 && $iconfont != "Custom" && $iconfont != "Dashicons") { wp_enqueue_style('ts-font-' . strtolower($iconfont)); } else { if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, 0) == 1 && get_option('ts_vcsc_extend_settings_load' . $iconfont, 0) == 1 && $iconfont != "Custom" && $iconfont == "Dashicons") { wp_enqueue_style('dashicons'); wp_enqueue_style('ts-font-' . strtolower($iconfont)); } else { if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, 0) == 1 && get_option('ts_vcsc_extend_settings_load' . $iconfont, 0) == 1 && $iconfont == "Custom") { $Custom_Font_CSS = get_option('ts_vcsc_extend_settings_tinymceCustomPath', ''); wp_enqueue_style('ts-font-' . strtolower($iconfont) . 'vcsc'); } } } } if ($this->TS_VCSC_EditorIconFontsInternal == "true") { foreach ($this->TS_VCSC_Composer_Icon_Fonts as $Icon_Font => $iconfont) { if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, 0) == 1 && get_option('ts_vcsc_extend_settings_load' . $iconfont, 0) == 1) { if (strtolower($iconfont) == "vc_awesome") { wp_enqueue_style('font-awesome'); } else { wp_enqueue_style(strtolower($iconfont)); } } } } } if ((stripos($post->post_content, '[TS-VCSC-') !== FALSE || stripos($post->post_content, '[TS_VCSC_') !== FALSE) && get_option('ts_vcsc_extend_settings_loadForcable', 0) == 0 && $TS_VCSC_StandardFrontendPage == "true") { // Load jQuery (if not already loaded) if ($this->TS_VCSC_LoadFrontEndJQuery == "true" && !wp_script_is('jquery')) { wp_enqueue_script('jquery'); } // Load Google Charts API if (TS_VCSC_CheckShortcode('TS-VCSC-Google-Charts') == "true") { wp_enqueue_script('ts-extend-google-charts'); } // Add CSS for each enabled Icon Font to Page foreach ($this->TS_VCSC_Installed_Icon_Fonts as $Icon_Font => $iconfont) { if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, 0) == 1 && $iconfont != "Custom" && $iconfont != "Dashicons") { wp_enqueue_style('ts-font-' . strtolower($iconfont)); } else { if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, 0) == 1 && $iconfont != "Custom" && $iconfont == "Dashicons") { wp_enqueue_style('dashicons'); wp_enqueue_style('ts-font-' . strtolower($iconfont)); } else { if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, 0) == 1 && $iconfont == "Custom") { $Custom_Font_CSS = get_option('ts_vcsc_extend_settings_tinymceCustomPath', ''); wp_enqueue_style('ts-font-' . strtolower($iconfont) . 'vcsc'); } } } } if ($this->TS_VCSC_EditorIconFontsInternal == "true") { foreach ($this->TS_VCSC_Composer_Icon_Fonts as $Icon_Font => $iconfont) { if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, 0) == 1) { if (strtolower($iconfont) == "vc_awesome") { wp_enqueue_style('font-awesome'); } else { wp_enqueue_style(strtolower($iconfont)); } } } } if ($this->TS_VCSC_VCFrontEditMode == "false") { // Load Modernizr if ($this->TS_VCSC_LoadFrontEndModernizr == "true") { wp_enqueue_script('ts-extend-modernizr'); } // Load Waypoints if ($this->TS_VCSC_LoadFrontEndWaypoints == "true") { if (wp_script_is('waypoints', $list = 'registered')) { wp_enqueue_script('waypoints'); } else { wp_enqueue_script('ts-extend-waypoints'); } } } // Add Custom CSS / JS to Page if (get_option('ts_vcsc_extend_settings_codeeditors', 1) == 1) { add_action('wp_head', array($this, 'TS_VCSC_DisplayCustomCSS')); add_action('wp_footer', array($this, 'TS_VCSC_DisplayCustomJS'), 9999); } } else { if (get_option('ts_vcsc_extend_settings_loadForcable', 0) == 1 && $TS_VCSC_StandardFrontendPage == "true") { // Load Google Charts API if (TS_VCSC_CheckShortcode('TS-VCSC-Google-Charts') == "true") { wp_enqueue_script('ts-extend-google-charts'); } if ($this->TS_VCSC_VCFrontEditMode == "false") { // Load Modernizr if ($this->TS_VCSC_LoadFrontEndModernizr == "true") { wp_enqueue_script('ts-extend-modernizr'); } // Load Waypoints if ($this->TS_VCSC_LoadFrontEndWaypoints == "true") { if (wp_script_is('waypoints', $list = 'registered')) { wp_enqueue_script('waypoints'); } else { wp_enqueue_script('ts-extend-waypoints'); } } } // Add CSS for each enabled Icon Font to Page foreach ($this->TS_VCSC_Installed_Icon_Fonts as $Icon_Font => $iconfont) { if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, 0) == 1 && $iconfont != "Custom" && $iconfont != "Dashicons") { wp_enqueue_style('ts-font-' . strtolower($iconfont)); } else { if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, 0) == 1 && $iconfont != "Custom" && $iconfont == "Dashicons") { wp_enqueue_style('dashicons'); wp_enqueue_style('ts-font-' . strtolower($iconfont)); } else { if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, 0) == 1 && $iconfont == "Custom") { $Custom_Font_CSS = get_option('ts_vcsc_extend_settings_tinymceCustomPath', ''); wp_enqueue_style('ts-font-' . strtolower($iconfont) . 'vcsc'); } } } } if ($this->TS_VCSC_EditorIconFontsInternal == "true") { foreach ($this->TS_VCSC_Composer_Icon_Fonts as $Icon_Font => $iconfont) { if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, 0) == 1) { if (strtolower($iconfont) == "vc_awesome") { wp_enqueue_style('font-awesome'); } else { wp_enqueue_style(strtolower($iconfont)); } } } } // Add custom CSS / JS to Page if (get_option('ts_vcsc_extend_settings_codeeditors', 1) == 1) { add_action('wp_head', array($this, 'TS_VCSC_DisplayCustomCSS')); add_action('wp_footer', array($this, 'TS_VCSC_DisplayCustomJS'), 9999); } // Load Other Required Files if ($this->TS_VCSC_VCFrontEditMode == "false") { wp_enqueue_style('ts-extend-simptip'); wp_enqueue_style('ts-extend-animations'); wp_enqueue_style('ts-extend-buttons'); wp_enqueue_style('ts-extend-buttonsflat'); wp_enqueue_style('ts-extend-tooltipster'); wp_enqueue_script('ts-extend-tooltipster'); wp_enqueue_style('ts-visual-composer-extend-front'); wp_enqueue_script('ts-visual-composer-extend-front'); } } else { // Add CSS for each enabled Font foreach ($this->TS_VCSC_Installed_Icon_Fonts as $Icon_Font => $iconfont) { if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, 0) == 1 && get_option('ts_vcsc_extend_settings_load' . $iconfont, 0) == 1 && $iconfont != "Custom" && $iconfont != "Dashicons") { wp_enqueue_style('ts-font-' . strtolower($iconfont)); } else { if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, 0) == 1 && get_option('ts_vcsc_extend_settings_load' . $iconfont, 0) == 1 && $iconfont != "Custom" && $iconfont == "Dashicons") { wp_enqueue_style('dashicons'); wp_enqueue_style('ts-font-' . strtolower($iconfont)); } else { if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, 0) == 1 && get_option('ts_vcsc_extend_settings_load' . $iconfont, 0) == 1 && $iconfont == "Custom") { $Custom_Font_CSS = get_option('ts_vcsc_extend_settings_tinymceCustomPath', ''); wp_enqueue_style('ts-font-' . strtolower($iconfont) . 'vcsc'); } } } } if ($this->TS_VCSC_EditorIconFontsInternal == "true") { foreach ($this->TS_VCSC_Composer_Icon_Fonts as $Icon_Font => $iconfont) { if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, 0) == 1) { if (strtolower($iconfont) == "vc_awesome") { wp_enqueue_style('font-awesome'); } else { wp_enqueue_style(strtolower($iconfont)); } } } } } } } }
function TS_VCSC_Extensions_Front_Main() { global $post; global $wp_query; $url = plugin_dir_url(__FILE__); require_once $this->assets_dir . 'ts_vcsc_registrations_files.php'; // Check For Standard Frontend Page if (!is_404() && !is_search() && !is_archive()) { $TS_VCSC_StandardFrontendPage = "true"; } else { $TS_VCSC_StandardFrontendPage = "false"; } // Load Scripts As Needed if (!empty($post)) { // Output of Custom CSS / JS $TS_VCSC_CustomCodeOutput = "false"; // Check for Standard Shortcodes if (stripos($post->post_content, '[TS-VCSC-') !== FALSE || stripos($post->post_content, '[TS_VCSC_') !== FALSE) { $TS_VCSC_StandardShorcodes = "true"; } else { $TS_VCSC_StandardShorcodes = "false"; } // Check for EnlighterJS Shortcodes if (stripos($post->post_content, '[TS_EnlighterJS_') !== FALSE) { $TS_VCSC_EnlighterShorcodes = "true"; } else { $TS_VCSC_EnlighterShorcodes = "false"; } // Define Ajax Path Variable /*if (stripos($post->post_content, '[TS_VCSC_Timeline_CSS_Container') !== FALSE) { wp_enqueue_style('ts-visual-composer-extend-ajax', $url . '/css/ts-visual-composer-extend-ajax.css', null, false, 'all'); wp_enqueue_script('ts-visual-composer-extend-ajax', $url . '/js/ts-visual-composer-extend-ajax.js', array('jquery'), false, true); wp_localize_script('ts-visual-composer-extend-ajax', '$TS_VCSC_AjaxData', array( 'ajaxurl' => admin_url('admin-ajax.php'), 'queryvars' => json_encode($wp_query->query) )); }*/ if ($this->TS_VCSC_UseSmoothScroll == "true") { wp_enqueue_script('ts-extend-mousewheel'); } if (($this->TS_VCSC_LoadFrontEndLightbox == "true" || get_option('ts_vcsc_extend_settings_lightboxIntegration', 0) == 1) && $TS_VCSC_StandardFrontendPage == "true" && $this->TS_VCSC_UseInternalLightbox == "true" && $this->TS_VCSC_VCFrontEditMode == "false") { wp_enqueue_script('ts-extend-hammer'); wp_enqueue_script('ts-extend-nacho'); wp_enqueue_style('ts-extend-nacho'); } if ($this->TS_VCSC_LoadFrontEndTooltips == "true" && $TS_VCSC_StandardFrontendPage == "true" && $this->TS_VCSC_VCFrontEditMode == "false") { wp_enqueue_style('ts-extend-simptip'); wp_enqueue_style('ts-extend-tooltipster'); wp_enqueue_script('ts-extend-tooltipster'); } if (get_option('ts_vcsc_extend_settings_loadFonts', 0) == 1) { // Add CSS for each enabled Font to WordPress Frontend foreach ($this->TS_VCSC_Installed_Icon_Fonts as $Icon_Font => $iconfont) { $default = $iconfont == "Awesome" ? 1 : 0; if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, $default) == 1 && get_option('ts_vcsc_extend_settings_load' . $iconfont, 0) == 1 && $iconfont != "Custom" && $iconfont != "Dashicons") { wp_enqueue_style('ts-font-' . strtolower($iconfont)); } else { if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, $default) == 1 && get_option('ts_vcsc_extend_settings_load' . $iconfont, 0) == 1 && $iconfont != "Custom" && $iconfont == "Dashicons") { wp_enqueue_style('dashicons'); wp_enqueue_style('ts-font-' . strtolower($iconfont)); } else { if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, $default) == 1 && get_option('ts_vcsc_extend_settings_load' . $iconfont, 0) == 1 && $iconfont == "Custom") { $Custom_Font_CSS = get_option('ts_vcsc_extend_settings_tinymceCustomPath', ''); wp_enqueue_style('ts-font-' . strtolower($iconfont) . 'vcsc'); } } } } if ($this->TS_VCSC_EditorIconFontsInternal == "true") { foreach ($this->TS_VCSC_Composer_Icon_Fonts as $Icon_Font => $iconfont) { if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, 0) == 1 && get_option('ts_vcsc_extend_settings_load' . $iconfont, 0) == 1) { if (strtolower($iconfont) == "vc_awesome") { wp_enqueue_style('font-awesome'); } else { wp_enqueue_style(strtolower($iconfont)); } } } } } /* Force Load of Core Files */ if ($this->TS_VCSC_LoadFrontEndForcable == "true" && $TS_VCSC_StandardFrontendPage == "true") { // Load jQuery (if not already loaded) if ($this->TS_VCSC_LoadFrontEndJQuery == "true" && !wp_script_is('jquery')) { wp_enqueue_script('jquery'); } // Load Google Charts API if (TS_VCSC_CheckShortcode('TS-VCSC-Google-Charts') == "true" || TS_VCSC_CheckShortcode('TS-VCSC-Google-Tables') == "true") { wp_enqueue_script('ts-extend-google-charts'); } if ($this->TS_VCSC_VCFrontEditMode == "false") { // Load Modernizr if ($this->TS_VCSC_LoadFrontEndModernizr == "true") { wp_enqueue_script('ts-extend-modernizr'); } // Load Waypoints if ($this->TS_VCSC_LoadFrontEndWaypoints == "true") { if (wp_script_is('waypoints', $list = 'registered')) { wp_enqueue_script('waypoints'); } else { wp_enqueue_script('ts-extend-waypoints'); } } } // Add CSS for each enabled Icon Font to Page $this->TS_VCSC_Extensions_Front_Fonts(); // Add custom CSS / JS to Page if ($this->TS_VCSC_UseCodeEditors == "true") { add_action('wp_head', array($this, 'TS_VCSC_DisplayCustomCSS')); add_action('wp_footer', array($this, 'TS_VCSC_DisplayCustomJS'), 9999); $TS_VCSC_CustomCodeOutput = "true"; } // Load Other Required Files if ($this->TS_VCSC_VCFrontEditMode == "false") { wp_enqueue_style('ts-extend-simptip'); wp_enqueue_style('ts-extend-animations'); wp_enqueue_style('ts-extend-buttons'); wp_enqueue_style('ts-extend-buttonsflat'); wp_enqueue_style('ts-extend-tooltipster'); wp_enqueue_script('ts-extend-tooltipster'); wp_enqueue_style('ts-visual-composer-extend-front'); wp_enqueue_script('ts-visual-composer-extend-front'); } } /* Files if Shortcode Detected or Widgets Activated */ if (($TS_VCSC_StandardShorcodes == "true" || $TS_VCSC_EnlighterShorcodes == "true") && $TS_VCSC_StandardFrontendPage == "true" || $this->TS_VCSC_CustomPostTypesWidgets == "true" && $TS_VCSC_StandardFrontendPage == "true") { // Load jQuery (if not already loaded) if ($this->TS_VCSC_LoadFrontEndJQuery == "true" && !wp_script_is('jquery')) { wp_enqueue_script('jquery'); } // Load MooTools (for EnlighterJS) if ($this->TS_VCSC_LoadFrontEndMooTools == "true" && $TS_VCSC_EnlighterShorcodes == "true") { wp_enqueue_script('ts-library-mootools'); } // Load Google Charts API if (TS_VCSC_CheckShortcode('TS-VCSC-Google-Charts') == "true" || TS_VCSC_CheckShortcode('TS-VCSC-Google-Tables') == "true") { wp_enqueue_script('ts-extend-google-charts'); } // Add CSS for each enabled Icon Font to Page $this->TS_VCSC_Extensions_Front_Fonts(); if ($this->TS_VCSC_VCFrontEditMode == "false") { // Load Modernizr if ($this->TS_VCSC_LoadFrontEndModernizr == "true") { wp_enqueue_script('ts-extend-modernizr'); } // Load Waypoints if ($this->TS_VCSC_LoadFrontEndWaypoints == "true") { if (wp_script_is('waypoints', $list = 'registered')) { wp_enqueue_script('waypoints'); } else { wp_enqueue_script('ts-extend-waypoints'); } } } // Add Custom CSS / JS to Page if ($this->TS_VCSC_UseCodeEditors == "true") { add_action('wp_head', array($this, 'TS_VCSC_DisplayCustomCSS')); add_action('wp_footer', array($this, 'TS_VCSC_DisplayCustomJS'), 9999); $TS_VCSC_CustomCodeOutput = "true"; } } else { // Add CSS for each enabled Font foreach ($this->TS_VCSC_Installed_Icon_Fonts as $Icon_Font => $iconfont) { $default = $iconfont == "Awesome" ? 1 : 0; if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, $default) == 1 && get_option('ts_vcsc_extend_settings_load' . $iconfont, 0) == 1 && $iconfont != "Custom" && $iconfont != "Dashicons") { wp_enqueue_style('ts-font-' . strtolower($iconfont)); } else { if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, $default) == 1 && get_option('ts_vcsc_extend_settings_load' . $iconfont, 0) == 1 && $iconfont != "Custom" && $iconfont == "Dashicons") { wp_enqueue_style('dashicons'); wp_enqueue_style('ts-font-' . strtolower($iconfont)); } else { if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, $default) == 1 && get_option('ts_vcsc_extend_settings_load' . $iconfont, 0) == 1 && $iconfont == "Custom") { $Custom_Font_CSS = get_option('ts_vcsc_extend_settings_tinymceCustomPath', ''); wp_enqueue_style('ts-font-' . strtolower($iconfont) . 'vcsc'); } } } } if ($this->TS_VCSC_EditorIconFontsInternal == "true") { foreach ($this->TS_VCSC_Composer_Icon_Fonts as $Icon_Font => $iconfont) { if (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, 0) == 1 && get_option('ts_vcsc_extend_settings_load' . $iconfont, 0) == 1) { if (strtolower($iconfont) == "vc_awesome") { wp_enqueue_style('font-awesome'); } else { wp_enqueue_style(strtolower($iconfont)); } } } } } if ($TS_VCSC_CustomCodeOutput == "false") { add_action('wp_head', array($this, 'TS_VCSC_DisplayCustomCSS')); add_action('wp_footer', array($this, 'TS_VCSC_DisplayCustomJS'), 9999); $TS_VCSC_CustomCodeOutput = "true"; } } }