本文整理汇总了PHP中presscore_get_shortcode_animation_html_class函数的典型用法代码示例。如果您正苦于以下问题:PHP presscore_get_shortcode_animation_html_class函数的具体用法?PHP presscore_get_shortcode_animation_html_class怎么用?PHP presscore_get_shortcode_animation_html_class使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了presscore_get_shortcode_animation_html_class函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: shortcode_icon
public function shortcode_icon($atts, $content = null)
{
extract(shortcode_atts(array('icon' => '', 'target_blank' => '1', 'link' => '#'), $atts));
static $social_icons = null;
if (!$social_icons) {
$social_icons = presscore_get_social_icons_data();
}
if ('deviant' == $icon) {
$icon = 'devian';
} elseif ('tumblr' == $icon) {
$icon = 'tumbler';
} elseif ('500px' == $icon) {
$icon = 'px-500';
} elseif (in_array($icon, array('youtube', 'YouTube'))) {
$icon = 'you-tube';
} elseif (in_array($icon, array('tripedvisor', 'tripadvisor'))) {
$icon = 'tripedvisor';
}
$icon = in_array($icon, array_keys($social_icons)) ? $icon : '';
if (empty($icon)) {
return '';
}
$classes = array();
if (presscore_shortcode_animation_on(self::$atts['animation'])) {
$classes[] = presscore_get_shortcode_animation_html_class(self::$atts['animation']);
}
$target_blank = apply_filters('dt_sanitize_flag', $target_blank) ? '_blank' : '';
$output = presscore_get_social_icon($icon, $link, $social_icons[$icon], $classes, $target_blank);
return $output;
}
示例2: render_logo
public function render_logo($attributes = array())
{
$post_id = get_the_ID();
if (!$post_id) {
return '';
}
$html = '';
$images = array('normal' => null, 'retina' => null);
$image_classes = array();
$esc_title = esc_attr(get_the_title());
$thumb_id = 0;
// get featured image
if (has_post_thumbnail($post_id)) {
$thumb_id = get_post_thumbnail_id($post_id);
$images['normal'] = wp_get_attachment_image_src($thumb_id, 'full');
}
// get retina image
$retina_logo_id = get_post_meta($post_id, '_dt_logo_options_retina_logo', true);
if ($retina_logo_id) {
$images['retina'] = dt_get_uploaded_logo(array('', $retina_logo_id[0]), 'retina');
}
// default image
$default_img = null;
foreach ($images as $image) {
if ($image) {
$default_img = $image;
break;
}
}
if (!$default_img) {
return '';
}
if (presscore_shortcode_animation_on($attributes['animation'])) {
$image_classes[] = presscore_get_shortcode_animation_html_class($attributes['animation']);
}
// ninjaaaa!
$image_classes = implode(' ', $image_classes);
// final image
if (presscore_is_srcset_based_retina()) {
$image = presscore_get_image_with_srcset($images['normal'], $images['retina'], $default_img, 'alt="' . $esc_title . '"', esc_attr($image_classes));
} else {
$image = dt_get_retina_sensible_image($images['normal'], $images['retina'], $default_img, 'alt="' . $esc_title . '"', esc_attr($image_classes));
}
// if link not empty - wrap image with it
$link = get_post_meta($post_id, '_dt_logo_options_link', true);
if ($link) {
$image_id = dt_is_hd_device() && isset($retina_logo_id[0]) ? $retina_logo_id[0] : $thumb_id;
$esc_caption = '';
$attachment = dt_get_attachment($image_id);
if ($attachment) {
$esc_caption = esc_attr($attachment['description']);
}
$link = esc_attr($link);
$image = '<a href="' . $link . '" target="_blank" title="' . $esc_caption . '" >' . $image . '</a>';
}
// get it all togeather
return $image;
}
示例3: shortcode
public function shortcode($atts, $content = null)
{
$default_atts = array('animation' => 'none');
extract(shortcode_atts($default_atts, $atts));
$classes = array();
if (presscore_shortcode_animation_on($animation)) {
$classes[] = presscore_get_shortcode_animation_html_class($animation);
}
// ninjaaaa!
$classes = implode(' ', $classes);
$output = '<div class="' . esc_attr($classes) . '">' . presscore_remove_wpautop($content, true) . '</div>';
return $output;
}
示例4: get_container_html_class
protected function get_container_html_class($custom_class = '')
{
$class = array();
if ($custom_class) {
$class[] = $custom_class;
}
if ($this->atts['link']) {
$class[] = 'shortcode-banner-link';
}
if (presscore_shortcode_animation_on($this->atts['animation'])) {
$class[] = presscore_get_shortcode_animation_html_class($this->atts['animation']);
}
return 'class="' . esc_attr(implode(' ', $class)) . '"';
}
示例5: shortcode
public function shortcode($atts, $content = null)
{
$default_atts = array('type' => 'blockquote', 'layout' => 'left', 'font_size' => 'big', 'size' => '1', 'animation' => 'none', 'background' => 'plain');
extract(shortcode_atts($default_atts, $atts));
$font_size = sanitize_key($font_size);
$type = sanitize_key($type);
$layout = sanitize_key($layout);
$size = sanitize_key($size);
$background = sanitize_key($background);
$classes = array();
$classes[] = presscore_get_font_size_class($font_size);
if (presscore_shortcode_animation_on($animation)) {
$classes[] = presscore_get_shortcode_animation_html_class($animation);
}
if ('blockquote' != $type) {
$tag = 'q';
$autop = false;
$classes[] = 'shortcode-pullquote';
$classes[] = 'wf-cell';
if ('right' == $layout) {
$classes[] = 'align-right';
} else {
$classes[] = 'align-left';
}
switch ($size) {
case '2':
$classes[] = 'wf-1-2';
break;
case '3':
$classes[] = 'wf-1-3';
break;
case '4':
$classes[] = 'wf-1-4';
break;
default:
$classes[] = 'wf-1';
}
} else {
$tag = 'blockquote';
$autop = true;
$classes[] = 'shortcode-blockquote';
if ('fancy' == $background) {
$classes[] = 'block-style-widget';
}
}
$classes = implode(' ', $classes);
$output = sprintf('<%1$s class="%2$s">%3$s</%1$s>', $tag, esc_attr($classes), presscore_remove_wpautop($content, $autop));
return $output;
}
示例6: get_container_html_class
protected function get_container_html_class($custom_class = '')
{
$class = array();
if ($custom_class) {
$class[] = $custom_class;
}
switch ($this->atts['style']) {
case '3':
$class[] = 'br-standard';
case '2':
$class[] = 'borderframe';
}
switch ($this->atts['align']) {
case 'left':
$class[] = 'alignleft';
break;
case 'right':
$class[] = 'alignright';
break;
case 'centre':
case 'center':
$class[] = 'alignnone';
break;
}
if (presscore_shortcode_animation_on($this->atts['animation'])) {
$class[] = presscore_get_shortcode_animation_html_class($this->atts['animation']);
}
if ($this->content) {
$class[] = 'caption-on';
}
$image_src = $this->choose_src_responsively($this->atts['image'], $this->atts['hd_image']);
$video_url = $this->atts['media'];
$lightbox = $this->atts['lightbox'];
if ($image_src && $video_url && !$lightbox || !$image_src && $video_url) {
$class[] = 'shortcode-single-video';
}
return 'class="' . esc_attr(implode(' ', $class)) . '"';
}
示例7: shortcode
public function shortcode($atts, $content = null)
{
$default_atts = array('style' => '1', 'image' => '', 'image_alt' => '', 'hd_image' => '', 'media' => '', 'padding' => '0', 'align' => '', 'animation' => 'none', 'width' => '');
$attributes = shortcode_atts($default_atts, $atts);
// $attributes['type'] = in_array( $attributes['type'], array('image', 'video') ) ? $attributes['type'] : $default_atts['type'];
$attributes['style'] = sanitize_key($attributes['style']);
$attributes['align'] = sanitize_key($attributes['align']);
$attributes['padding'] = intval($attributes['padding']);
$attributes['width'] = absint($attributes['width']);
$attributes['image'] = esc_url($attributes['image']);
$attributes['image_alt'] = esc_attr($attributes['image_alt']);
$attributes['hd_image'] = esc_url($attributes['hd_image']);
$attributes['media'] = esc_url($attributes['media']);
// $attributes['lightbox'] = apply_filters('dt_sanitize_flag', $attributes['lightbox']);
$container_classes = array('shortcode-single-image-wrap');
$media_classes = array('shortcode-single-image');
$container_style = array();
$media = '';
$content_block = '';
$content = strip_shortcodes($content);
$attributes['type'] = 'video';
$attributes['lightbox'] = 1;
switch ($attributes['style']) {
case '3':
$container_classes[] = 'br-standard';
case '2':
$container_classes[] = 'borderframe';
$style = ' style="padding: ' . esc_attr($attributes['padding']) . 'px"';
break;
default:
$style = '';
}
switch ($attributes['align']) {
case 'left':
$container_classes[] = 'alignleft';
break;
case 'right':
$container_classes[] = 'alignright';
break;
case 'centre':
case 'center':
$container_classes[] = 'alignnone';
break;
}
if (presscore_shortcode_animation_on($attributes['animation'])) {
$container_classes[] = presscore_get_shortcode_animation_html_class($attributes['animation']);
}
if ($content) {
$container_classes[] = 'caption-on';
$content_block = '<div class="shortcode-single-caption">' . $content . '</div>';
}
$default_image_src = $attributes['image'] ? $attributes['image'] : $attributes['hd_image'];
if (dt_retina_on()) {
$image_src = dt_is_hd_device() ? $attributes['hd_image'] : $attributes['image'];
} else {
$image_src = $attributes['image'];
}
if (empty($image_src)) {
$image_src = $default_image_src;
}
$media = sprintf('<img src="%s" alt="%s" />', $image_src, $attributes['image_alt']);
$media = sprintf('<div class="rollover-video">%s<a class="video-icon dt-single-mfp-popup dt-mfp-item mfp-iframe" href="%s" title="%s" data-dt-img-description="%s"></a></div>', $media, $attributes['media'], $attributes['image_alt'], esc_attr($content));
if ($media) {
$media = sprintf('<div class="%s"%s><div class="fancy-media-wrap">%s</div></div>', esc_attr(implode(' ', $media_classes)), $style, $media);
}
if ($attributes['width']) {
$container_style[] = 'width: ' . $attributes['width'] . 'px';
}
$output = sprintf('<div class="%s"%s>%s</div>', esc_attr(implode(' ', $container_classes)), $container_style ? ' style="' . esc_attr(implode(';', $container_style)) . '"' : '', $media . $content_block);
return $output;
}
示例8: get_container_html_class
protected function get_container_html_class($custom_class = '')
{
$container_classes = array();
if ($custom_class) {
$container_classes[] = $custom_class;
}
switch ($this->atts['style']) {
case '1':
$container_classes[] = 'box-style-table';
break;
default:
$container_classes[] = 'table';
}
switch ($this->atts['background']) {
case 'fancy':
$container_classes[] = 'shortcode-action-bg';
$container_classes[] = 'block-style-widget';
break;
case 'plain':
$container_classes[] = 'shortcode-action-bg';
$container_classes[] = 'plain-bg';
break;
}
/**
* @deprecated Only for backward compatibility
*/
if (in_array($this->atts['text_align'], array('center', 'centre'))) {
$container_classes[] = 'text-centered';
}
if (!$this->atts['line']) {
$container_classes[] = 'no-line';
}
if (presscore_shortcode_animation_on($this->atts['animation'])) {
$container_classes[] = presscore_get_shortcode_animation_html_class($this->atts['animation']);
}
return 'class="' . esc_attr(implode(' ', $container_classes)) . '"';
}
示例9: shortcode
public function shortcode($atts, $content = null)
{
$default_atts = array('type' => '', 'style' => '1', 'image' => '', 'image_alt' => '', 'image_id' => '', 'image_width' => '', 'image_height' => '', 'misc_link' => '', 'target' => 'blank', 'media' => '', 'background' => 'plain', 'lightbox' => '0', 'content_size' => 'big', 'text_align' => 'left', 'animation' => 'none');
$attributes = shortcode_atts($default_atts, $atts);
$attributes['type'] = sanitize_key($attributes['type']);
$attributes['target'] = sanitize_key($attributes['target']);
$attributes['style'] = sanitize_key($attributes['style']);
$attributes['background'] = sanitize_key($attributes['background']);
$attributes['content_size'] = sanitize_key($attributes['content_size']);
$attributes['text_align'] = sanitize_key($attributes['text_align']);
$attributes['image_id'] = absint($attributes['image_id']);
$attributes['image_alt'] = esc_attr($attributes['image_alt']);
$attributes['image_width'] = absint($attributes['image_width']);
$attributes['image_height'] = absint($attributes['image_height']);
$attributes['misc_link'] = esc_url($attributes['misc_link']);
$attributes['lightbox'] = apply_filters('dt_sanitize_flag', $attributes['lightbox']);
$attributes['media'] = esc_url($attributes['media']);
$container_classes = array('shortcode-teaser');
$content_classes = array('shortcode-teaser-content');
$media = '';
// container classes
if ('1' == $attributes['style']) {
$container_classes[] = 'img-full';
}
switch ($attributes['background']) {
case 'fancy':
$container_classes[] = 'frame-fancy';
case 'plain':
$container_classes[] = 'frame-on';
}
if (in_array($attributes['text_align'], array('center', 'centre'))) {
$container_classes[] = 'text-centered';
}
// content classes
switch ($attributes['content_size']) {
case 'small':
$content_classes[] = 'text-small';
break;
case 'normal':
$content_classes[] = 'text-normal';
break;
case 'big':
default:
$content_classes[] = 'text-big';
}
if (presscore_shortcode_animation_on($attributes['animation'])) {
$container_classes[] = presscore_get_shortcode_animation_html_class($attributes['animation']);
}
if ('uploaded_image' == $attributes['type']) {
$attributes['image'] = $attributes['image_id'];
$attributes['media'] = '';
} else {
if ('image' == $attributes['type']) {
$attributes['media'] = '';
} else {
if ('video' == $attributes['type']) {
$attributes['image'] = '';
}
}
}
// if media url is set - do some stuff
if ($attributes['media']) {
$container_classes[] = 'shortcode-single-video';
$media = sprintf('<div class="shortcode-teaser-img"><div class="shortcode-teaser-video">%s</div></div>', dt_get_embed($attributes['media']));
// if image is set
} elseif ($attributes['image']) {
if (is_numeric($attributes['image'])) {
$image_id = absint($attributes['image']);
$image_info = wp_get_attachment_image_src($image_id, 'full');
// get image src
if (!$image_info) {
$image_info = presscore_get_default_image();
}
$image_src = $image_info[0];
// get image alt
if (empty($attributes['image_alt'])) {
$attributes['image_alt'] = esc_attr(get_post_meta($image_id, '_wp_attachment_image_alt', true));
}
// get image dimensions
$attributes['image_width'] = $image_info[1];
$attributes['image_height'] = $image_info[2];
} else {
$image_src = esc_url($attributes['image']);
}
// format image dimesions
$image_dimension_attrs = '';
if ($attributes['image_width'] > 0 && $attributes['image_height'] > 0) {
$image_dimension_attrs .= ' width="' . $attributes['image_width'] . '"';
$image_dimension_attrs .= ' height="' . $attributes['image_height'] . '"';
}
$media = sprintf('<img src="%s" alt="%s"%s />', $image_src, $attributes['image_alt'], $image_dimension_attrs);
if ($attributes['lightbox']) {
$media = sprintf('<a class="rollover rollover-zoom dt-single-mfp-popup dt-mfp-item mfp-image" href="%s" title="%s" data-dt-img-description="%s">%s</a>', $image_src, esc_attr($attributes['image_alt']), '', $media);
} else {
if ($attributes['misc_link']) {
$media = sprintf('<a class="rollover" href="%s"%s>%s</a>', $attributes['misc_link'], 'blank' == $attributes['target'] ? ' target="_blank"' : '', $media);
}
}
$media = sprintf('<div class="shortcode-teaser-img">%s</div>', $media);
}
//.........这里部分代码省略.........
示例10: str_replace
}
$img['thumbnail'] = str_replace('<img ', '<img data-vc-zoom="' . $large_img_src . '" ', $img['thumbnail']);
break;
}
// backward compatibility
if (vc_has_class('prettyphoto', $el_class)) {
$el_class = vc_remove_class('prettyphoto', $el_class);
}
$html = 'vc_box_shadow_3d' === $style ? '<span class="vc_box_shadow_3d_wrap">' . $img['thumbnail'] . '</span>' : $img['thumbnail'];
if ($link) {
$a_attrs['href'] = $link;
$a_attrs['target'] = $img_link_target;
$html = '<a ' . vc_stringify_attributes($a_attrs) . '>' . $html . '</a>';
}
$html = '<div class="vc_single_image-wrapper ' . $style . ' ' . $border_color . '">' . $html . '</div>';
$class_to_filter = 'wpb_single_image wpb_content_element vc_align_' . $alignment . ' ' . presscore_get_shortcode_animation_html_class($css_animation);
$class_to_filter .= vc_shortcode_custom_css_class($css, ' ') . $this->getExtraClass($el_class);
$css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts);
if (in_array($source, array('media_library', 'featured_image')) && 'yes' === $add_caption) {
$post = get_post($img_id);
$caption = $post->post_excerpt;
} else {
if ('external_link' === $source) {
$add_caption = 'yes';
}
}
if ('yes' === $add_caption && '' !== $caption) {
$html = '
<figure class="vc_figure">
' . $html . '
<figcaption class="vc_figure-caption">' . esc_html($caption) . '</figcaption>
示例11: array
* @var string $color
* @var string $css_animation
* @var string $message_box_type
* @var string $message_box_style
* @var string $message_box_shape
* @var string $message_box_color
* @var string $icon_type
*/
$defaultFont = 'fontawesome';
$defaultIconClass = 'fa fa-info-circle';
//$this->convert..
$atts = $this->convertAttributesToMessageBox2($atts);
$defaults = array('el_class' => '', 'message_box_style' => 'classic', 'style' => 'rounded', 'color' => '', 'message_box_color' => 'alert-info', 'css_animation' => '', 'icon_type' => $defaultFont, 'icon_fontawesome' => $defaultIconClass);
$atts = vc_shortcode_attribute_parse($defaults, $atts);
extract($atts);
$elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'vc_message_box', $this->settings['base'], $atts), 'style' => 'vc_message_box-' . $message_box_style, 'shape' => 'vc_message_box-' . $style, 'color' => strlen($color) > 0 && strpos('alert', $color) === false ? 'vc_color-' . $color : 'vc_color-' . $message_box_color, 'extra' => $this->getExtraClass($el_class), 'css_animation' => presscore_get_shortcode_animation_html_class($css_animation));
$elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass));
// Pick up icons
$iconClass = isset(${"icon_" . $icon_type}) ? ${"icon_" . $icon_type} : $defaultIconClass;
switch ($color) {
case 'info':
$icon_type = 'fontawesome';
$iconClass = 'fa fa-info-circle';
break;
case 'alert-info':
$icon_type = 'pixelicons';
$iconClass = 'vc_pixel_icon vc_pixel_icon-info';
break;
case 'success':
$icon_type = 'fontawesome';
$iconClass = 'fa fa-check';
示例12: vc_map_get_attributes
<?php
if (!defined('ABSPATH')) {
exit;
// Exit if accessed directly
}
/**
* Shortcode attributes
* @var $atts
* @var $el_class
* @var $css_animation
* @var $css
* @var $content - shortcode content
* Shortcode class
* @var $this WPBakeryShortCode_VC_Column_text
*/
$el_class = $css = $css_animation = '';
$atts = vc_map_get_attributes($this->getShortcode(), $atts);
extract($atts);
$class_to_filter = 'wpb_text_column wpb_content_element ' . presscore_get_shortcode_animation_html_class($css_animation);
$class_to_filter .= vc_shortcode_custom_css_class($css, ' ') . $this->getExtraClass($el_class);
$css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts);
$output = '
<div class="' . esc_attr($css_class) . '">
<div class="wpb_wrapper">
' . wpb_js_remove_wpautop($content, true) . '
</div>
</div>
';
echo $output;
示例13: extract
* @var string $style
* @var string $color
* @var string $size
* @var string $open
* @var string $css_animation
*
* @var array $atts
*/
extract(shortcode_atts(array('title' => __("Click to toggle", "js_composer"), 'el_class' => '', 'style' => 'default', 'color' => 'default', 'size' => '', 'open' => 'false', 'css_animation' => '', 'el_id' => ''), $atts));
// checking is color inverted
$style = str_replace('_outline', '', $style, $inverted);
/**
* class wpb_toggle removed since 4.4
* @since 4.4
*/
$elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'vc_toggle', $this->settings['base'], $atts), 'style' => 'vc_toggle_' . $style, 'color' => $color ? 'vc_toggle_color_' . $color : '', 'inverted' => $inverted ? 'vc_toggle_color_inverted' : '', 'size' => $size ? 'vc_toggle_size_' . $size : '', 'open' => $open == 'true' ? 'vc_toggle_active' : '', 'extra' => $this->getExtraClass($el_class), 'css_animation' => presscore_get_shortcode_animation_html_class($css_animation));
$elementClass = trim(implode(' ', $elementClass));
?>
<div <?php
echo isset($el_id) && !empty($el_id) ? "id='" . esc_attr($el_id) . "'" : "";
?>
class="<?php
echo esc_attr($elementClass);
?>
">
<div
class="vc_toggle_title"><?php
echo apply_filters('wpb_toggle_heading', '<h4>' . esc_html($title) . '</h4>', array('title' => $title, 'open' => $open));
?>
<i class="vc_toggle_icon"></i></div>
<div
示例14: shortcode_benefit
public function shortcode_benefit($atts, $content = null)
{
$attributes = shortcode_atts(array('image_link' => '', 'target_blank' => 'true', 'image' => '', 'hd_image' => '', 'header_size' => 'h4', 'title' => '', 'content_size' => 'normal'), $atts);
$attributes['image_link'] = esc_url($attributes['image_link']);
$attributes['image'] = esc_url($attributes['image']);
$attributes['hd_image'] = esc_url($attributes['hd_image']);
$attributes['header_size'] = in_array($attributes['header_size'], array('h2', 'h3', 'h4', 'h5', 'h6')) ? $attributes['header_size'] : 'h4';
$attributes['content_size'] = in_array($attributes['content_size'], array('normal', 'small', 'big')) ? $attributes['content_size'] : 'normal';
$attributes['title'] = wp_kses($attributes['title'], array());
$attributes['target_blank'] = apply_filters('dt_sanitize_flag', $attributes['target_blank']);
$image = '';
$title = '';
$output = '';
$default_image = null;
$images = array($attributes['image'], $attributes['hd_image']);
// get default logo
foreach ($images as $img) {
if ($img) {
$default_image = $img;
break;
}
}
if (!empty($default_image)) {
if (dt_retina_on()) {
$image = dt_is_hd_device() ? $images[1] : $images[0];
} else {
$image = $images[0];
}
if (empty($image)) {
$image = $default_image;
}
// ssl support
$image = dt_make_image_src_ssl_friendly($image);
$image = sprintf('<img src="%s" alt="" />', $image);
$image_classes = array('benefits-grid-ico');
if (presscore_shortcode_animation_on(self::$atts['animation'])) {
$image_classes[] = presscore_get_shortcode_animation_html_class(self::$atts['animation']);
}
// ninjaaaa!
$image_classes = esc_attr(implode(' ', $image_classes));
if ($attributes['image_link']) {
$image = sprintf('<a href="%s" class="%s"%s>%s</a>', $attributes['image_link'], $image_classes, $attributes['target_blank'] ? ' target="_blank"' : '', $image);
} else {
$image = sprintf('<span class="%s">%s</span>', $image_classes, $image);
}
}
if ($attributes['title']) {
$title = sprintf('<%1$s>%2$s</%1$s>', $attributes['header_size'], $attributes['title']);
}
$style = '1';
$column = '4';
$dividers = ' class="borders"';
if (!empty(self::$atts)) {
$style = self::$atts['style'];
$column = self::$atts['columns'];
$dividers = !self::$atts['dividers'] ? $dividers = '' : $dividers;
}
switch ($column) {
case '1':
$column_class = 'wf-1';
break;
case '2':
$column_class = 'wf-1-2';
break;
case '3':
$column_class = 'wf-1-3';
break;
case '5':
$column_class = 'wf-1-5';
break;
default:
$column_class = 'wf-1-4';
}
switch ($style) {
case '2':
$output = sprintf('<div class="wf-cell %s"><div%s><div class="text-%s"><div class="wf-table"><div class="wf-td">%s</div><div class="wf-td">%s</div></div>%s</div></div></div>', $column_class, $dividers, $attributes['content_size'], $image, $title, do_shortcode(wpautop($content)));
break;
case '3':
$output = sprintf('<div class="wf-cell %s"><div%s><div class="text-%s"><div class="wf-table"><div class="wf-td">%s</div><div class="wf-td benefits-inner">%s</div></div></div></div></div>', $column_class, $dividers, $attributes['content_size'], $image, $title . do_shortcode(wpautop($content)));
break;
default:
$output = sprintf('<div class="wf-cell %s"><div%s><div class="text-%s">%s</div></div></div>', $column_class, $dividers, $attributes['content_size'], $image . $title . do_shortcode(wpautop($content)));
}
return $output;
}
示例15: wpb_getImageBySize
} else {
if (!empty($img_link)) {
$link_to = $img_link;
if (!preg_match('/^(https?\\:\\/\\/|\\/\\/)/', $link_to)) {
$link_to = 'http://' . $link_to;
}
$a_class = ' class="' . $rollover_class . $img_class . ' ' . $style . '"';
}
}
}
//to disable relative links uncomment this..
if (!empty($a_class)) {
$img_class = '';
}
$img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => 'vc_single_image-img'));
if ($img == NULL) {
$img['thumbnail'] = '<img class="vc_img-placeholder ' . $img_class . '" src="' . vc_asset_url('vc/no_image.png') . '" />';
}
//' <small>'.__('This is image placeholder, edit your page to replace it.', 'the7mk2').'</small>';
$img_output = $style == 'vc_box_shadow_3d' ? '<span class="vc_box_shadow_3d_wrap">' . $img['thumbnail'] . '</span>' : $img['thumbnail'];
$image_string = !empty($link_to) ? '<div class="vc_single_image-wrapper ' . $style . ' ' . $border_color . '"><a' . $a_class . ' href="' . $link_to . '"' . ' target="' . $img_link_target . '"' . '>' . $img_output . '</a></div>' : '<div class="vc_single_image-wrapper ' . $style . ' ' . $border_color . '">' . $img_output . '</div>';
$css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_single_image wpb_content_element' . $el_class . vc_shortcode_custom_css_class($css, ' '), $this->settings['base'], $atts);
$css_class .= ' ' . presscore_get_shortcode_animation_html_class($css_animation);
$css_class .= ' vc_align_' . $alignment;
$output .= "\n\t" . '<div class="' . $css_class . '">';
$output .= "\n\t\t" . '<div class="wpb_wrapper">';
$output .= "\n\t\t\t" . wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_singleimage_heading'));
$output .= "\n\t\t\t" . $image_string;
$output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper');
$output .= "\n\t" . '</div> ' . $this->endBlockComment('.wpb_single_image');
echo $output;