コード例 #1
0
ファイル: featured_image.php プロジェクト: severnrescue/web
$atts = array();
parse_str($data, $atts);
$el_class = $image = $img_size = $img_link = $img_link_target = $img_link_large = $title = $alignment = $css_animation = $css = '';
$image_string = '';
$img_class = new WPBakeryShortCode_VC_Single_image(array('base' => 'vc_single_image'));
/** @var $img_class WPBakeryShortCode_VC_Single_image */
$atts = vc_map_get_attributes($img_class->getShortcode(), $atts);
extract($atts);
$style = '' !== $style ? $style : '';
$border_color = '' !== $border_color ? ' vc_box_border_' . $border_color : '';
$img_id = get_post_thumbnail_id($post->ID);
$img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => 'vc_single_image-img'));
$img = apply_filters('vc_gitem_attribute_featured_image_img', $img);
if (null === $img || false === $img) {
    return '';
}
$el_class = $img_class->getExtraClass($el_class);
$wrapperClass = 'vc_single_image-wrapper ' . $style . ' ' . $border_color;
$link = vc_gitem_create_link_real($atts, $post, '', $title);
$image_string = !empty($link) ? '<' . $link . '>' . $img['thumbnail'] . '</a>' : '<div class="' . $wrapperClass . '">' . $img['thumbnail'] . '</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, ' '), $img_class->settings('base'), $atts);
$css_class .= $img_class->getCSSAnimation($css_animation);
$css_class .= ' vc_align_' . $alignment;
$output = '
	<div class="' . $css_class . '">
		<figure class="wpb_wrapper vc_figure">
			' . $image_string . '
		</figure>
	</div>
';
return $output;
コード例 #2
0
parse_str($data, $atts);
$el_class = $image = $img_size = $img_link = $img_link_target = $img_link_large = $title = $alignment = $css_animation = $css = '';
$image_string = '';
$img_class = new WPBakeryShortCode_VC_Single_image(array('base' => 'vc_single_image'));
/** @var $img_class WPBakeryShortCode_VC_Single_image */
$atts = vc_map_get_attributes($img_class->getShortcode(), $atts);
extract($atts);
$style = '' !== $style ? $style : '';
$border_color = '' !== $border_color ? ' vc_box_border_' . $border_color : '';
$img_id = has_post_thumbnail($post->ID) ? get_post_thumbnail_id($post->ID) : $post->ID;
$img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => 'vc_single_image-img'));
$img = apply_filters('vc_gitem_attribute_featured_image_img', $img);
if (null === $img || false === $img) {
    return '';
}
$el_class = $img_class->getExtraClass($el_class);
$style = preg_replace('/_circle_2$/', '_circle', $style);
$wrapperClass = 'vc_single_image-wrapper ' . $style . ' ' . $border_color;
$link = vc_gitem_create_link_real($atts, $post, $wrapperClass, $title);
$image_string = !empty($link) ? '<' . $link . '>' . $img['thumbnail'] . '</a>' : '<div class="' . $wrapperClass . '">' . $img['thumbnail'] . '</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, ' '), $img_class->settings('base'), $atts);
$css_class .= $img_class->getCSSAnimation($css_animation);
$css_class .= ' vc_align_' . $alignment;
$output = '
	<div class="' . $css_class . '">
		<figure class="wpb_wrapper vc_figure">
			' . $image_string . '
		</figure>
	</div>
';
return $output;
コード例 #3
0
ファイル: vc_btn.php プロジェクト: arkev/IntelligentMode
}
if ('custom' === $style) {
    $inline_css = vc_get_css_color('background-color', $custom_background) . vc_get_css_color('color', $custom_text);
} elseif ('outline-custom' === $style) {
    $inline_css = vc_get_css_color('border-color', $outline_custom_color) . vc_get_css_color('color', $outline_custom_color);
    $attributes[] = 'onmouseenter="this.style.borderColor=\'' . $outline_custom_hover_background . '\'; this.style.backgroundColor=\'' . $outline_custom_hover_background . '\'; this.style.color=\'' . $outline_custom_hover_text . '\'"';
    $attributes[] = 'onmouseleave="this.style.borderColor=\'' . $outline_custom_color . '\'; this.style.backgroundColor=\'transparent\'; this.style.color=\'' . $outline_custom_color . '\'"';
} else {
    $button_class .= ' vc_btn3-color-' . $color . ' ';
}
if ('' !== $inline_css) {
    $inline_css = ' style="' . $inline_css . '"';
}
$attributes = implode(' ', $attributes);
$link = trim($link);
// Add link
$use_link = strlen($link) > 0 && 'none' !== $link;
$link_output = '';
if ($use_link) {
    $link_output = vc_gitem_create_link_real($atts, $post, 'vc_general vc_btn3 ' . trim($button_class), $title);
}
$output = '<div class="' . esc_attr(trim($css_class)) . ' vc_btn3-' . esc_attr($align) . '">';
if (preg_match('/href=\\"[^\\"]+/', $link_output)) {
    $output .= '<' . $link_output . ' ' . $inline_css . ' ' . $attributes . '>' . $button_html . '</a>';
} elseif ('load-more-grid' === $link) {
    $output .= '<a href="javascript:;" class="vc_general vc_btn3 ' . esc_attr($button_class) . '" ' . $inline_css . ' ' . $attributes . '>' . $button_html . '</a>';
} else {
    $output .= '<button class="vc_general vc_btn3 ' . esc_attr($button_class) . '"' . $inline_css . ' ' . $attributes . '>' . $button_html . '</button>';
}
$output .= '</div>';
return $output;
コード例 #4
0
ファイル: featured_image.php プロジェクト: syncopetwice/STG
<?php

$atts = array();
parse_str($data, $atts);
$output = $el_class = $image = $img_size = $img_link = $img_link_target = $img_link_large = $title = $alignment = $css_animation = $css = '';
$image_string = '';
extract(shortcode_atts(array('title' => '', 'image' => $image, 'img_size' => 'full', 'link' => '', 'img_link_target' => '_self', 'alignment' => 'left', 'el_class' => '', 'css_animation' => '', 'style' => '', 'border_color' => '', 'css' => ''), $atts));
require_once vc_path_dir('SHORTCODES_DIR', 'vc-single-image.php');
$img_class = new WPBakeryShortCode_VC_Single_image(array('base' => 'vc_single_image'));
$style = $style != '' ? $style : '';
$border_color = $border_color != '' ? ' vc_box_border_' . $border_color : '';
$img_id = get_post_thumbnail_id($post->ID);
$img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => 'vc_single_image-img'));
$img = apply_filters('vc_gitem_attribute_featured_image_img', $img);
if (NULL === $img || false === $img) {
    return $output;
}
$el_class = $img_class->getExtraClass($el_class);
$link = vc_gitem_create_link_real($atts, $post);
$img_output = $style == 'vc_box_shadow_3d' ? '<span class="vc_box_shadow_3d_wrap">' . $img['thumbnail'] . '</span>' : $img['thumbnail'];
$image_string = !empty($link) ? '<' . $link . '><div class="vc_single_image-wrapper ' . $style . ' ' . $border_color . '">' . $img_output . '</div></a>' : '<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, ' '), $img_class->settings('base'), $atts);
$css_class .= $img_class->getCSSAnimation($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" . $image_string;
$output .= "\n\t\t" . '</div> ' . $img_class->endBlockComment('.wpb_wrapper');
$output .= "\n\t" . '</div> ' . $img_class->endBlockComment('.wpb_single_image');
return $output;