本文整理汇总了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
}