当前位置: 首页>>代码示例>>PHP>>正文


PHP RevSliderFunctionsWP::check_for_shortcodes方法代码示例

本文整理汇总了PHP中RevSliderFunctionsWP::check_for_shortcodes方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSliderFunctionsWP::check_for_shortcodes方法的具体用法?PHP RevSliderFunctionsWP::check_for_shortcodes怎么用?PHP RevSliderFunctionsWP::check_for_shortcodes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RevSliderFunctionsWP的用法示例。


在下文中一共展示了RevSliderFunctionsWP::check_for_shortcodes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: rev_slider_shortcode

 function rev_slider_shortcode($args, $mid_content = null)
 {
     extract(shortcode_atts(array('alias' => ''), $args, 'rev_slider'));
     $sliderAlias = $alias != '' ? $alias : RevSliderFunctions::getVal($args, 0);
     $gal_ids = RevSliderFunctionsWP::check_for_shortcodes($mid_content);
     //check for example on gallery shortcode and do stuff
     ob_start();
     if (!empty($gal_ids)) {
         //add a gallery based slider
         $slider = RevSliderOutput::putSlider($sliderAlias, '', $gal_ids);
     } else {
         $slider = RevSliderOutput::putSlider($sliderAlias);
     }
     $content = ob_get_contents();
     ob_clean();
     ob_end_clean();
     // Do not output Slider if we are on mobile
     $disable_on_mobile = $slider->getParam("disable_on_mobile", "off");
     if ($disable_on_mobile == 'on') {
         $mobile = strstr($_SERVER['HTTP_USER_AGENT'], 'Android') || strstr($_SERVER['HTTP_USER_AGENT'], 'webOS') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPod') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPad') || strstr($_SERVER['HTTP_USER_AGENT'], 'Windows Phone') || wp_is_mobile() ? true : false;
         if ($mobile) {
             return false;
         }
     }
     $show_alternate = $slider->getParam("show_alternative_type", "off");
     if ($show_alternate == 'mobile' || $show_alternate == 'mobile-ie8') {
         if (wp_is_mobile()) {
             $show_alternate_image = $slider->getParam("show_alternate_image", "");
             return '<img class="tp-slider-alternative-image" src="' . $show_alternate_image . '" data-no-retina>';
         }
     }
     //handle slider output types
     if (!empty($slider)) {
         $outputType = $slider->getParam("output_type", "");
         switch ($outputType) {
             case "compress":
                 $content = str_replace("\n", "", $content);
                 $content = str_replace("\r", "", $content);
                 return $content;
                 break;
             case "echo":
                 echo $content;
                 //bypass the filters
                 break;
             default:
                 return $content;
                 break;
         }
     } else {
         return $content;
     }
     //normal output
 }
开发者ID:GTACSolutions,项目名称:Telios,代码行数:53,代码来源:revslider.php


注:本文中的RevSliderFunctionsWP::check_for_shortcodes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。