Example #1
0
 function vc_theme_vc_single_image($atts, $content = null)
 {
     $output = $a_class = $el_class = $image = $img_size = $img_link = $img_link_target = $img_link_large = $title = $css_animation = '';
     extract(shortcode_atts(array('title' => '', 'image' => '', 'img_src' => '', 'img_size' => 'thumbnail', 'img_link_large' => false, 'link' => '', 'img_link_target' => '_self', 'el_class' => '', 'css_animation' => ''), $atts));
     $img_id = preg_replace('/[^\\d]/', '', $image);
     $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size));
     $link_to = '';
     if ($img_link_large == true) {
         $link_to = wp_get_attachment_image_src($img_id, 'large');
         $link_to = $link_to[0];
     } else {
         if (!empty($link)) {
             $link_to = $link;
         }
     }
     if ($img == NULL) {
         if ($img_link_large == true) {
             $link_to = $img_src;
         }
         $img = array('thumbnail' => '<img src="' . $img_src . '">');
     }
     $el_class = ' ' . $el_class . ' ';
     if ($img_link_large == true) {
         $a_class = ' rel="lightbox"';
     }
     $image_string = !empty($link_to) ? '<a' . $a_class . ' href="' . $link_to . '"' . ($img_link_target != '_self' ? ' target="' . $img_link_target . '"' : '') . '>' . $img['thumbnail'] . '</a>' : $img['thumbnail'];
     $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_single_image wpb_content_element' . $el_class);
     $css_class .= getCSSAnimation($css_animation);
     $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> ';
     $output .= "\n\t" . '</div> ';
     return $output;
 }
Example #2
0
 function vc_theme_vc_toggle($atts, $content = null)
 {
     $output = $title = $css_class = $el_class = $open = $css_animation = '';
     extract(shortcode_atts(array('title' => __("Click to toggle", "js_composer"), 'el_class' => '', 'style' => 'default', 'open' => 'false', 'css_animation' => ''), $atts));
     $open = $open == 'true' ? 1 : 0;
     $css_class .= getCSSAnimation($css_animation);
     $css_class .= ' ' . $el_class;
     $output .= '<div class="toggle-block ' . $css_class . ' ' . $style . '">' . do_shortcode('[toggle title="' . $title . '" class="' . $css_class . '" active="' . $open . '"]' . wpb_js_remove_wpautop($content) . '[/toggle]') . '</div>';
     return $output;
 }
        wp_enqueue_script('prettyphoto');
        wp_enqueue_style('prettyphoto');
        $a_class .= ' prettyphoto';
        $el_class = str_ireplace('prettyphoto', '', $el_class);
    }
    if (in_array('pull-right', $tmp_class) && '' !== $href) {
        $a_class .= ' pull-right';
        $el_class = str_ireplace('pull-right', '', $el_class);
    }
    if (in_array('pull-left', $tmp_class) && '' !== $href) {
        $a_class .= ' pull-left';
        $el_class = str_ireplace('pull-left', '', $el_class);
    }
}
$delay = !empty($delay) ? 'data-delay="' . $delay . '"' : '';
$css_animation = getCSSAnimation($css_animation);
$inline_button = !empty($inline_button) && $inline_button == 'yes' ? ' inline_button' : '';
if ('same' === $target || '_self' === $target) {
    $target = '';
}
$target = '' !== $target ? ' target="' . esc_attr($target) . '"' : '';
$style = $style == '3d' ? ' style_3d' : '';
$shape = $shape == 'round' || $shape == 'rounded' ? ' shape_' . $shape : '';
$full_width = $full_width === 'true' ? ' full_width' : '';
if ($add_icon === 'true') {
    vc_icon_element_fonts_enqueue($icon_type);
    $iconClass = isset(${"icon_" . $icon_type}) ? ${"icon_" . $icon_type} : 'fa fa-info-circle';
    $icon_render = '<i class="' . $iconClass . '"></i>';
} else {
    $i_align = '';
}
function ctitle_func($atts, $content = null)
{
    extract(shortcode_atts(array('title' => 'We sell quality', 'color' => '#666666', 'background' => '#ffffff', 'font_size' => '30', 'font_weight' => 'normal', 'uppercase' => 'yes', 'position' => 'center', 'separator_color' => '#ebebeb', 'el_width' => '100', 'css_animation' => '', 'delay' => '', 'el_class' => ''), $atts));
    $html = '';
    $delay = !empty($delay) ? 'data-delay="' . $delay . '"' : '';
    if (function_exists('getCSSAnimation')) {
        $css_animation = getCSSAnimation($css_animation);
    }
    $font_size = $font_size != '' ? 'font-size: ' . $font_size . 'px;' : '';
    $font_weight = $font_weight != 'normal' ? 'font-weight:' . $font_weight . ';' : '';
    $uppercase = $uppercase != 'no' ? 'text-transform: uppercase;' : '';
    $color = $color != '' ? 'color:' . $color . ';' : '';
    $background = $background != '' ? 'background-color:' . $background . ';' : '';
    /*
    if($position == 'left') {
    		  $position = 'vc_separator_align_left';
    }
    elseif($position == 'right') {
    		  $position = 'vc_separator_align_right';
    }
    else {
    		  $position = '';
    }
    */
    $position_sep = $position != '' ? 'vc_sep_pos_align_' . $position : '';
    $position_text = $position != '' ? 'vc_separator_align_' . $position : '';
    $separator_color = $separator_color != '' ? 'style="border-color:' . $separator_color . ';"' : '';
    $el_width = $el_width != '' ? ' vc_sep_width_' . $el_width : ' vc_sep_width_100';
    $style = 'style="' . $font_size . $font_weight . $uppercase . $color . $background . '"';
    $html .= '<div class="vc_separator ' . $position_text . ' ' . $position_sep . ' ' . $el_width . ' ' . $css_animation . ' ' . $el_class . '" ' . $delay . '>';
    $html .= '<span class="vc_sep_holder vc_sep_holder_l"><span class="vc_sep_line" ' . $separator_color . '></span></span>';
    $html .= '<h4 ' . $style . '>' . $title . '</h4>';
    $html .= '<span class="vc_sep_holder vc_sep_holder_r"><span class="vc_sep_line" ' . $separator_color . '></span></span>';
    $html .= '</div>';
    return $html;
    // return '<div class="content_box_title" '.$style.'><span class="white" style="background-color: '.$background.'; color:'.$color.'; '.$margin.'">'.$title.'</span></div>';
}