コード例 #1
0
 * @var $render
 * @var $content - shortcode content
 * Shortcode class
 * @var $this WPBakeryShortCode_VC_Gitem_Zone
 */
$el_class = $css = $position = $bgimage = $height = $link = $url = $height_mode = $featured_image = $render = $rel = '';
$css_style = $css_style_mini = '';
$image_block = $image = '';
$atts = vc_map_get_attributes($this->getShortcode(), $atts);
extract($atts);
if ('no' === $render) {
    echo '';
    return;
}
// Here we check content. If it doesn't contain any useful content, not to render all this staff.
if ('yes' !== $featured_image && empty($css) && empty($el_class) && empty($height) && !vc_gitem_has_content($content)) {
    return;
}
$css_class = 'vc_gitem-zone' . (strlen($this->zone_name) ? ' vc_gitem-zone-' . $this->zone_name : '');
$css_class_mini = 'vc_gitem-zone-mini';
// Autoheight Mode
// http://jsfiddle.net/tL2pgtyb/4/ {{
// Set css classes for shortcode main html element wrapper and background block
$css_class .= vc_shortcode_custom_css_class($css, ' ') . (strlen($el_class) ? ' ' . $el_class : '');
preg_match('/background(\\-image)?\\s*\\:\\s*[^\\s]*?\\s*url\\(\'?([^\\)]+)\'?\\)/', $css, $img_matches);
$background_image_css_editor = isset($img_matches[2]) ? $img_matches[2] : false;
if ('custom' === $height_mode) {
    if (strlen($height) > 0) {
        if (preg_match('/^\\d+$/', $height)) {
            $height .= 'px';
        }
コード例 #2
0
<?php

/**
 * Shortcode attributes
 * @var $atts
 * @var $css
 * @var $el_class
 * @var $position
 * @var $content - shortcode content
 * Shortcode class
 * @var $this WPBakeryShortCode_VC_Gitem_Row
 */
$css = $el_class = $position = '';
extract(shortcode_atts(array('css' => '', 'el_class' => '', 'position' => 'top'), $atts));
$css_class = 'vc_gitem_row vc_row' . (strlen($el_class) ? ' ' . $el_class : '') . vc_shortcode_custom_css_class($css, ' ') . ($position ? ' vc_gitem-row-position-' . $position : '');
if (!vc_gitem_has_content($content)) {
    return;
}
echo '<div class="' . esc_attr($css_class) . '">' . do_shortcode($content) . '</div>';