本文整理汇总了PHP中PBValidation::isVideoURL方法的典型用法代码示例。如果您正苦于以下问题:PHP PBValidation::isVideoURL方法的具体用法?PHP PBValidation::isVideoURL怎么用?PHP PBValidation::isVideoURL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PBValidation
的用法示例。
在下文中一共展示了PBValidation::isVideoURL方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processShortcodeGallery
function processShortcodeGallery($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$html = null;
$elementHTML = null;
$Layout = new PBLayout();
$Validation = new PBValidation();
$ImageHover = new PBImageHover();
$file = PBFile::getImage(explode(',', $attribute['image']));
if ($file === false) {
return $html;
}
if (!count($file->posts)) {
return $html;
}
if (!PBFile::isWPImage($attribute['image_size'])) {
return $html;
}
if (!array_key_exists($attribute['layout'], $this->layout)) {
return $html;
}
if (!$Validation->isBool($attribute['hover_enable'])) {
return $html;
}
if (!array_key_exists($attribute['hover_type'], $ImageHover->type)) {
return $html;
}
if (!$Validation->isBool($attribute['caption_enable'])) {
return $html;
}
if (!$Validation->isBool($attribute['preloader_enable'])) {
return $html;
}
if (!$Validation->isBool($attribute['description_enable'])) {
return $html;
}
if (!$Validation->isBool($attribute['layout_full_width_enable'])) {
return $html;
}
$key = array('hover_type', 'hover_enable', 'preloader_enable', 'layout_full_width_enable');
foreach ($key as $index) {
$option[$index] = $attribute[$index];
}
$id = PBHelper::createId('pb_gallery');
global $post;
$bPost = $post;
$i = 0;
while ($file->have_posts()) {
global $post;
$file->the_post();
$full = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
$thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), $attribute['image_size']);
$meta = PBMeta::get($post);
PBHelper::removeUIndex($meta, 'media_library_video_url', 'media_library_url');
$class = array();
$class[0] = array('pb-layout-' . $Layout->getLayoutColumnCSSClass($attribute['layout'], $i));
$class[1] = array('pb-image-box');
$class[2] = array('pb-image');
if ($attribute['preloader_enable'] == 1) {
array_push($class[1], 'pb-image-preloader', 'pb-image-preloader-animation-enable');
}
if ($attribute['hover_enable'] == 1) {
array_push($class[1], 'pb-image-hover', 'pb-image-hover-type-' . $attribute['hover_type']);
}
/****/
$imageTextHTML = null;
if ($Validation->isNotEmpty($post->post_excerpt) && $attribute['caption_enable'] == 1) {
$imageTextHTML .= '<' . PBComponentData::get($this->getComponentId(), 'image_text_caption_header_tag') . ' class="pb-image-text-caption">' . get_the_excerpt() . '</' . PBComponentData::get($this->getComponentId(), 'image_text_caption_header_tag') . '>';
}
if ($Validation->isNotEmpty($post->post_content) && $attribute['description_enable'] == 1) {
$imageTextHTML .= '<div class="pb-image-text-description">' . get_the_content() . '</div>';
}
if ($Validation->isNotEmpty($imageTextHTML)) {
$imageTextHTML = '<div class="pb-image-text">' . $imageTextHTML . '</div>';
}
if ($Validation->isNotEmpty($imageTextHTML)) {
$imageTextHTML .= '<div class="pb-image-text-fancybox"><b>' . get_the_excerpt() . '</b> ' . get_the_content() . '</div>';
}
/****/
$url = null;
$rel = null;
if ($Validation->isVideoURL($meta['media_library_video_url'])) {
$url = $meta['media_library_video_url'];
array_push($class[1], 'pb-image-type-video');
} elseif ($Validation->isURL($meta['media_library_url'])) {
$url = $meta['media_library_url'];
array_push($class[1], 'pb-image-type-link');
} else {
$rel = $id;
$url = $full[0];
array_push($class[1], 'pb-image-type-image');
}
/****/
$imageHTML = null;
if ($attribute['hover_enable'] == 1) {
$imageHTML = '<a href="' . $url . '"' . PBHelper::createClassAttribute($class[2]) . ($Validation->isEmpty($rel) ? null : ' data-fancybox-group="' . esc_attr($rel) . '"') . '><img src="' . $thumbnail[0] . '" alt=""/><span><span><span></span></span></span></a>';
} else {
$imageHTML = '<div' . PBHelper::createClassAttribute($class[2]) . '><img src="' . $thumbnail[0] . '" alt=""/></div>';
}
/****/
//.........这里部分代码省略.........