function yit_revslider_slider() { $operations = new RevOperations(); $arrValues = $operations->getGeneralSettingsValues(); $includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally","on"); $isWidgetActive = is_active_widget( false, false, "rev-slider-widget", true ); $hasShortcode = UniteFunctionsWPRev::hasShortcode("rev_slider"); if ( yit_slider_get_setting('slider_type',yit_slider_name()) != 'revolution-slider' || $includesGlobally == "on" || $isWidgetActive || $hasShortcode ) { return; } wp_enqueue_style('rs-plugin-settings', RS_PLUGIN_URL .'public/assets/css/settings.css', array(), RevSliderGlobals::SLIDER_REVISION); $custom_css = RevOperations::getStaticCss(); $custom_css = UniteCssParserRev::compress_css($custom_css); wp_add_inline_style('rs-plugin-settings', $custom_css); $setBase = (is_ssl()) ? "https://" : "http://"; $url_jquery = $setBase . "ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=revolution"; wp_enqueue_script("jquery", $url_jquery); // put javascript to footer add_action('wp_footer', array($GLOBALS['productFront'], 'putJavascript')); }
/** * Remove Add to wishlist text option * */ function yit_add_slider_class_body() { $slider_name = yit_slider_name(); if ($slider_name == 'none' || empty($slider_name)) { return; } $slider_type = yit_slider_get_setting('slider_type', $slider_name); $slider_width = yit_slider_get_setting('width_' . $slider_type, $slider_name); if (in_array($slider_type, array('revolution', 'revolution-slider', 'elastic', 'thumbnails')) && $slider_width == 0) { $is_full_width = true; } else { $is_full_width = false; } // revolution slider if ($slider_type == 'revolution-slider' && class_exists('RevSlider')) { $revolution = yit_slider_get_setting('slider_name_' . $slider_type, $slider_name); $the_slider = new RevSlider(); $the_slider->initByMixed($revolution); if (in_array($the_slider->getParam('slider_type'), array('fixed', 'responsitive'))) { $is_full_width = false; } } yit_add_body_class('header-slider-' . $slider_type); yit_add_body_class('slider-' . ($is_full_width ? 'full-width' : 'fixed')); }
/** * Return an array with all sliders created. * * @param string $class Extra class. * * @since 1.0 */ function yit_get_sliders($slider_type = false) { $posts = yit_get_model('cpt_unlimited')->get_posts_types('sliders'); $return = array(); foreach ($posts as $post) { if ($slider_type != false && $slider_type != yit_slider_get_setting('slider_type', $post->post_name)) { continue; } if ($post->post_title) { $return["{$post->post_name}"] = $post->post_title; } else { $return["{$post->post_name}"] = "Slider ID: " . $post->post_name; } } return $return; }