This commit is contained in:
KhaiNguyen
2020-02-13 10:39:37 +07:00
commit 59401cb805
12867 changed files with 4646216 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $id
* @var $el_class
* Shortcode class
* @var WPBakeryShortCode_Layerslider_Vc $this
*/
$el_class = $title = $id = '';
$output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$el_class = $this->getExtraClass( $el_class );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_layerslider_element wpb_content_element' . $el_class, $this->settings['base'], $atts );
$output .= '<div class="' . esc_attr( $css_class ) . '">';
$output .= wpb_widget_title( array(
'title' => $title,
'extraclass' => 'wpb_layerslider_heading',
) );
$output .= apply_filters( 'vc_layerslider_shortcode', do_shortcode( '[layerslider id="' . esc_attr( $id ) . '"]' ) );
$output .= '</div>';
echo $output;

View File

@@ -0,0 +1,31 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/** @var array $block_data */
$block = $block_data[0];
$settings = $block_data[1];
$link_setting = empty( $settings[0] ) ? '' : $settings[0];
$output = '';
if ( 'title' === $block ) {
$output .= '<h2 class="post-title">';
$output .= empty( $link_setting ) || 'no_link' !== $link_setting ? $this->getLinked( $post, $post->title, $link_setting, 'link_title' ) : $post->title;
$output .= '</h2>';
} elseif ( 'image' === $block && ! empty( $post->thumbnail ) ) {
$output .= '<div class="post-thumb">';
$output .= empty( $link_setting ) || 'no_link' !== $link_setting ? $this->getLinked( $post, $post->thumbnail, $link_setting, 'link_image' ) : $post->thumbnail;
$output .= '</div>';
} elseif ( 'text' === $block ) {
$output .= '<div class="entry-content">';
$output .= empty( $link_setting ) || 'text' === $link_setting ? $post->content : $post->excerpt;
$output .= '</div>';
} elseif ( 'link' === $block ) {
$output .= '<a href="' . esc_url( $post->link ) . '" class="vc_read_more" title="' . sprintf( esc_attr__( 'Permalink to %s', 'js_composer' ), esc_attr( $post->title_attribute ) ) . '" ';
$output .= $this->link_target;
$output .= '>';
$output .= esc_html__( 'Read more', 'js_composer' );
$output .= '</a>';
}
return $output;

View File

@@ -0,0 +1,31 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $alias
* @var $el_class
* Shortcode class
* @var WPBakeryShortCode_Rev_Slider_Vc $this
*/
$title = $alias = $el_class = '';
$output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$el_class = $this->getExtraClass( $el_class );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_revslider_element wpb_content_element' . $el_class, $this->settings['base'], $atts );
$output .= '<div class="' . esc_attr( $css_class ) . '">';
$output .= wpb_widget_title( array(
'title' => $title,
'extraclass' => 'wpb_revslider_heading',
) );
$output .= apply_filters( 'vc_revslider_shortcode', do_shortcode( '[rev_slider alias="' . $alias . '"]' ) );
$output .= '</div>';
echo $output;

View File

@@ -0,0 +1,39 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @deprecated
* Shortcode attributes
* @var $atts
* @var $title
* @var $el_class
* @var $collapsible
* @var $disable_keyboard
* @var $active_tab
* @var $content - shortcode content
* Shortcode class
* @var WPBakeryShortCode_Vc_Accordion $this
*/
$title = $el_class = $collapsible = $disable_keyboard = $active_tab = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
wp_enqueue_script( 'jquery-ui-accordion' );
$el_class = $this->getExtraClass( $el_class );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_accordion wpb_content_element ' . $el_class . ' not-column-inherit', $this->settings['base'], $atts );
$output = '
<div class="' . esc_attr( $css_class ) . '" data-collapsible="' . esc_attr( $collapsible ) . '" data-vc-disable-keydown="' . ( esc_attr( ( 'yes' === $disable_keyboard ? 'true' : 'false' ) ) ) . '" data-active-tab="' . esc_attr( $active_tab ) . '">
<div class="wpb_wrapper wpb_accordion_wrapper ui-accordion">
' . wpb_widget_title( array(
'title' => $title,
'extraclass' => 'wpb_accordion_heading',
) ) . '
' . wpb_js_remove_wpautop( $content ) . '
</div>
</div>
';
return $output;

View File

@@ -0,0 +1,31 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @deprecated
* Shortcode attributes
* @var $atts
* @var $title
* @var $el_id
* @var $content - shortcode content
* Shortcode class
* @var WPBakeryShortCode_Vc_Accordion_tab $this
*/
$title = $el_id = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_accordion_section group', $this->settings['base'], $atts );
$output = '
<div ' . ( isset( $el_id ) && ! empty( $el_id ) ? "id='" . esc_attr( $el_id ) . "'" : '' ) . 'class="' . esc_attr( $css_class ) . '">
<h3 class="wpb_accordion_header ui-accordion-header"><a href="#' . sanitize_title( $title ) . '">' . $title . '</a></h3>
<div class="wpb_accordion_content ui-accordion-content vc_clearfix">
' . ( ( '' === trim( $content ) ) ? esc_html__( 'Empty section. Edit page to add content here.', 'js_composer' ) : wpb_js_remove_wpautop( $content ) ) . '
</div>
</div>
';
return $output;

View File

@@ -0,0 +1,63 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var array $atts
* @var $content - shortcode content
* Shortcode class
* @var WPBakeryShortCode_Vc_Basic_Grid $this
*/
$this->post_id = false;
$this->items = array();
$css = $el_class = '';
$posts = $filter_terms = array();
$this->buildAtts( $atts, $content );
$css = isset( $atts['css'] ) ? $atts['css'] : '';
$el_class = isset( $atts['el_class'] ) ? $atts['el_class'] : '';
$class_to_filter = 'vc_grid-container vc_clearfix wpb_content_element ' . $this->shortcode;
$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 );
wp_enqueue_script( 'prettyphoto' );
wp_enqueue_style( 'prettyphoto' );
if ( 'true' === $this->atts['btn_add_icon'] ) {
vc_icon_element_fonts_enqueue( $this->atts['btn_i_type'] );
}
$this->buildGridSettings();
if ( isset( $this->atts['style'] ) && 'pagination' === $this->atts['style'] ) {
wp_enqueue_script( 'twbs-pagination' );
}
if ( ! empty( $atts['page_id'] ) ) {
$this->grid_settings['page_id'] = (int) $atts['page_id'];
}
$this->enqueueScripts();
$animation = isset( $this->atts['initial_loading_animation'] ) ? $this->atts['initial_loading_animation'] : 'zoomIn';
// Used for preload first page
if ( ! vc_is_page_editable() ) {
$haystack = array(
'load-more',
'lazy',
'all',
);
if ( in_array( $this->atts['style'], $haystack, true ) && in_array( $this->settings['base'], array( 'vc_basic_grid' ), true ) ) {
$this->atts['max_items'] = 'all' === $this->atts['style'] || $this->atts['items_per_page'] > $this->atts['max_items'] ? $this->atts['max_items'] : $this->atts['items_per_page'];
$this->buildItems();
}
}
$output = '
<div class="vc_grid-container-wrapper vc_clearfix"' . ( ! empty( $atts['el_id'] ) ? ' id="' . esc_attr( $atts['el_id'] ) . '"' : '' ) . '>
<div class="' . esc_attr( $css_class ) . '" data-initial-loading-animation="' . esc_attr( $animation ) . '" data-vc-' . esc_attr( $this->pagable_type ) . '-settings="' . esc_attr( wp_json_encode( $this->grid_settings ) ) . '" data-vc-request="' . esc_attr( apply_filters( 'vc_grid_request_url', admin_url( 'admin-ajax.php' ) ) ) . '" data-vc-post-id="' . esc_attr( get_the_ID() ) . '" data-vc-public-nonce="' . esc_attr( vc_generate_nonce( 'vc-public-nonce' ) ) . '">
' . $this->renderItems() . '
</div>
</div>';
return $output;

View File

@@ -0,0 +1,45 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
*/
$output = '';
if ( 'yes' === $atts['show_filter'] && ! empty( $filter_terms ) ) {
$unique_terms = array_unique( $filter_terms );
$terms_ids = ! empty( $atts['exclude_filter'] ) ? array_diff( $unique_terms, // Posts filter terms
array_map( 'abs', preg_split( '/\s*\,\s*/', $atts['exclude_filter'] ) ) ) : $unique_terms;
$terms = count( $terms_ids ) > 0 ? get_terms( $atts['filter_source'], array(
'include' => implode( ',', $terms_ids ),
) ) : array();
$filter_default = $atts['filter_default_title'];
if ( empty( $filter_default ) ) {
$filter_default = esc_html__( 'All', 'js_composer' );
}
if ( 'dropdown' !== $atts['filter_style'] ) {
$output .= '<ul class="vc_grid-filter vc_clearfix vc_grid-filter-' . esc_attr( $atts['filter_style'] ) . ' vc_grid-filter-size-' . esc_attr( $atts['filter_size'] ) . ' vc_grid-filter-' . esc_attr( $atts['filter_align'] ) . ' vc_grid-filter-color-' . esc_attr( $atts['filter_color'] ) . '" data-vc-grid-filter="' . esc_attr( $atts['filter_source'] ) . '"><li class="vc_active vc_grid-filter-item"><span data-vc-grid-filter-value="*">';
$output .= esc_attr( $filter_default );
$output .= '</span></li>';
foreach ( $terms as $term ) {
$output .= '<li class="vc_grid-filter-item"><span' . ' data-vc-grid-filter-value=".vc_grid-term-' . esc_attr( $term->term_id ) . '">';
$output .= esc_attr( $term->name );
$output .= '</span></li>';
}
$output .= '</ul>';
}
$output .= '<div class="' . ( 'dropdown' === $atts['filter_style'] ? 'vc_grid-filter-dropdown' : 'vc_grid-filter-select' ) . ' vc_grid-filter-' . esc_attr( $atts['filter_align'] ) . ' vc_grid-filter-color-' . esc_attr( $atts['filter_color'] ) . '" data-vc-grid-filter-select="' . esc_attr( $atts['filter_source'] ) . '"><div class="vc_grid-styled-select"><select data-filter="' . esc_attr( $atts['filter_source'] ) . '"><option class="vc_active" value="*">' . esc_attr( $filter_default ) . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>';
foreach ( $terms as $term ) {
$output .= '<option value=".vc_grid-term-' . esc_attr( $term->term_id ) . '">' . esc_html( $term->name ) . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>';
}
$output .= '</select><i class="vc_arrow-icon-navicon"></i>
</div>
</div>';
}
return $output;

View File

@@ -0,0 +1,242 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $style
* @var $shape
* @var $color
* @var $custom_background
* @var $custom_text
* @var $size
* @var $align
* @var $link
* @var $title
* @var $button_block
* @var $el_id
* @var $el_class
* @var $outline_custom_color
* @var $outline_custom_hover_background
* @var $outline_custom_hover_text
* @var $add_icon
* @var $i_align
* @var $i_type
* @var $i_icon_fontawesome
* @var $i_icon_openiconic
* @var $i_icon_typicons
* @var $i_icon_entypo
* @var $i_icon_linecons
* @var $i_icon_pixelicons
* @var $css_animation
* @var $css
* @var $gradient_color_1
* @var $gradient_color_2
* @var $gradient_custom_color_1 ;
* @var $gradient_custom_color_2 ;
* @var $gradient_text_color ;
* Shortcode class
* @var WPBakeryShortCode_Vc_Btn $this
*/
$style = $shape = $color = $size = $custom_background = $custom_text = $align = $link = $title = $button_block = $el_class = $outline_custom_color = $outline_custom_hover_background = $outline_custom_hover_text = $add_icon = $i_align = $i_type = $i_icon_entypo = $i_icon_fontawesome = $i_icon_linecons = $i_icon_pixelicons = $i_icon_typicons = $css = $css_animation = '';
$gradient_color_1 = $gradient_color_2 = $gradient_custom_color_1 = $gradient_custom_color_2 = $gradient_text_color = '';
$custom_onclick = $custom_onclick_code = '';
$a_href = $a_title = $a_target = $a_rel = '';
$styles = array();
$icon_wrapper = false;
$icon_html = false;
$attributes = array();
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
// parse link
$link = trim( $link );
$link = ( '||' === $link ) ? '' : $link;
$link = vc_build_link( $link );
$use_link = false;
if ( strlen( $link['url'] ) > 0 ) {
$use_link = true;
$a_href = $link['url'];
$a_href = apply_filters( 'vc_btn_a_href', $a_href );
$a_title = $link['title'];
$a_title = apply_filters( 'vc_btn_a_title', $a_title );
$a_target = $link['target'];
$a_rel = $link['rel'];
}
$wrapper_classes = array(
'vc_btn3-container',
$this->getExtraClass( $el_class ),
$this->getCSSAnimation( $css_animation ),
'vc_btn3-' . $align,
);
$button_classes = array(
'vc_general',
'vc_btn3',
'vc_btn3-size-' . $size,
'vc_btn3-shape-' . $shape,
'vc_btn3-style-' . $style,
);
$button_html = $title;
if ( '' === trim( $title ) ) {
$button_classes[] = 'vc_btn3-o-empty';
$button_html = '<span class="vc_btn3-placeholder">&nbsp;</span>';
}
if ( 'true' === $button_block && 'inline' !== $align ) {
$button_classes[] = 'vc_btn3-block';
}
if ( 'true' === $add_icon ) {
$button_classes[] = 'vc_btn3-icon-' . $i_align;
vc_icon_element_fonts_enqueue( $i_type );
if ( isset( ${'i_icon_' . $i_type} ) ) {
if ( 'pixelicons' === $i_type ) {
$icon_wrapper = true;
}
$icon_class = ${'i_icon_' . $i_type};
} else {
$icon_class = 'fa fa-adjust';
}
if ( $icon_wrapper ) {
$icon_html = '<i class="vc_btn3-icon"><span class="vc_btn3-icon-inner ' . esc_attr( $icon_class ) . '"></span></i>';
} else {
$icon_html = '<i class="vc_btn3-icon ' . esc_attr( $icon_class ) . '"></i>';
}
if ( 'left' === $i_align ) {
$button_html = $icon_html . ' ' . $button_html;
} else {
$button_html .= ' ' . $icon_html;
}
}
$output = '';
if ( 'custom' === $style ) {
if ( $custom_background ) {
$styles[] = vc_get_css_color( 'background-color', $custom_background );
}
if ( $custom_text ) {
$styles[] = vc_get_css_color( 'color', $custom_text );
}
if ( ! $custom_background && ! $custom_text ) {
$button_classes[] = 'vc_btn3-color-grey';
}
} elseif ( 'outline-custom' === $style ) {
if ( $outline_custom_color ) {
$styles[] = vc_get_css_color( 'border-color', $outline_custom_color );
$styles[] = vc_get_css_color( 'color', $outline_custom_color );
$attributes[] = 'onmouseleave="this.style.borderColor=\'' . $outline_custom_color . '\'; this.style.backgroundColor=\'transparent\'; this.style.color=\'' . $outline_custom_color . '\'"';
} else {
$attributes[] = 'onmouseleave="this.style.borderColor=\'\'; this.style.backgroundColor=\'transparent\'; this.style.color=\'\'"';
}
$onmouseenter = array();
if ( $outline_custom_hover_background ) {
$onmouseenter[] = 'this.style.borderColor=\'' . $outline_custom_hover_background . '\';';
$onmouseenter[] = 'this.style.backgroundColor=\'' . $outline_custom_hover_background . '\';';
}
if ( $outline_custom_hover_text ) {
$onmouseenter[] = 'this.style.color=\'' . $outline_custom_hover_text . '\';';
}
if ( $onmouseenter ) {
$attributes[] = 'onmouseenter="' . implode( ' ', $onmouseenter ) . '"';
}
if ( ! $outline_custom_color && ! $outline_custom_hover_background && ! $outline_custom_hover_text ) {
$button_classes[] = 'vc_btn3-color-inverse';
foreach ( $button_classes as $k => $v ) {
if ( 'vc_btn3-style-outline-custom' === $v ) {
unset( $button_classes[ $k ] );
break;
}
}
$button_classes[] = 'vc_btn3-style-outline';
}
} elseif ( 'gradient' === $style || 'gradient-custom' === $style ) {
$gradient_color_1 = vc_convert_vc_color( $gradient_color_1 );
$gradient_color_2 = vc_convert_vc_color( $gradient_color_2 );
$button_text_color = '#fff';
if ( 'gradient-custom' === $style ) {
$gradient_color_1 = $gradient_custom_color_1;
$gradient_color_2 = $gradient_custom_color_2;
$button_text_color = $gradient_text_color;
}
$gradient_css = array();
$gradient_css[] = 'color: ' . $button_text_color;
$gradient_css[] = 'border: none';
$gradient_css[] = 'background-color: ' . $gradient_color_1;
$gradient_css[] = 'background-image: -webkit-linear-gradient(left, ' . $gradient_color_1 . ' 0%, ' . $gradient_color_2 . ' 50%,' . $gradient_color_1 . ' 100%)';
$gradient_css[] = 'background-image: linear-gradient(to right, ' . $gradient_color_1 . ' 0%, ' . $gradient_color_2 . ' 50%,' . $gradient_color_1 . ' 100%)';
$gradient_css[] = '-webkit-transition: all .2s ease-in-out';
$gradient_css[] = 'transition: all .2s ease-in-out';
$gradient_css[] = 'background-size: 200% 100%';
// hover css
$gradient_css_hover = array();
$gradient_css_hover[] = 'color: ' . $button_text_color;
$gradient_css_hover[] = 'background-color: ' . $gradient_color_2;
$gradient_css_hover[] = 'border: none';
$gradient_css_hover[] = 'background-position: 100% 0';
$uid = uniqid();
$first_tag = 'style';
$output .= '<' . $first_tag . '>.vc_btn3-style-' . esc_attr( $style ) . '.vc_btn-gradient-btn-' . esc_attr( $uid ) . ':hover{' . esc_attr( implode( ';', $gradient_css_hover ) ) . ';' . '}</' . $first_tag . '>';
$output .= '<' . $first_tag . '>.vc_btn3-style-' . esc_attr( $style ) . '.vc_btn-gradient-btn-' . esc_attr( $uid ) . '{' . esc_attr( implode( ';', $gradient_css ) ) . ';' . '}</' . $first_tag . '>';
$button_classes[] = 'vc_btn-gradient-btn-' . $uid;
$attributes[] = 'data-vc-gradient-1="' . $gradient_color_1 . '"';
$attributes[] = 'data-vc-gradient-2="' . $gradient_color_2 . '"';
} else {
$button_classes[] = 'vc_btn3-color-' . $color;
}
if ( $styles ) {
$attributes[] = 'style="' . implode( ' ', $styles ) . '"';
}
$class_to_filter = implode( ' ', array_filter( $wrapper_classes ) );
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
if ( $button_classes ) {
$button_classes = esc_attr( apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, implode( ' ', array_filter( $button_classes ) ), $this->settings['base'], $atts ) );
$attributes[] = 'class="' . trim( $button_classes ) . '"';
}
if ( $use_link ) {
$attributes[] = 'href="' . esc_url( trim( $a_href ) ) . '"';
$attributes[] = 'title="' . esc_attr( trim( $a_title ) ) . '"';
if ( ! empty( $a_target ) ) {
$attributes[] = 'target="' . esc_attr( trim( $a_target ) ) . '"';
}
if ( ! empty( $a_rel ) ) {
$attributes[] = 'rel="' . esc_attr( trim( $a_rel ) ) . '"';
}
}
if ( ! empty( $custom_onclick ) && $custom_onclick_code ) {
$attributes[] = 'onclick="' . esc_attr( $custom_onclick_code ) . '"';
}
$attributes = implode( ' ', $attributes );
$output .= '<div class="' . esc_attr( trim( $css_class ) ) . '"' . ( ! empty( $el_id ) ? ' id="' . esc_attr( $el_id ) . '"' : '' ) . ' >';
if ( $use_link ) {
$output .= '<a ' . $attributes . '>' . $button_html . '</a>';
} else {
$output .= '<button ' . $attributes . '>' . $button_html . '</button>';
}
$output .= '</div>';
return $output;

View File

@@ -0,0 +1,66 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $color
* @var $size
* @var $icon
* @var $target
* @var $href
* @var $el_class
* @var $title
* Shortcode class
* @var WPBakeryShortCode_Vc_Button $this
*/
$color = $size = $icon = $target = $href = $el_class = $title = '';
$output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$a_class = '';
if ( '' !== $el_class ) {
$tmp_class = explode( ' ', strtolower( $el_class ) );
$tmp_class = str_replace( '.', '', $tmp_class );
if ( in_array( 'prettyphoto', $tmp_class, true ) ) {
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, true ) && '' !== $href ) {
$a_class .= ' pull-right';
$el_class = str_ireplace( 'pull-right', '', $el_class );
}
if ( in_array( 'pull-left', $tmp_class, true ) && '' !== $href ) {
$a_class .= ' pull-left';
$el_class = str_ireplace( 'pull-left', '', $el_class );
}
}
if ( 'same' === $target || '_self' === $target ) {
$target = '';
}
$target = ( '' !== $target ) ? ' target="' . esc_attr( $target ) . '"' : '';
$color = ( '' !== $color ) ? ' wpb_' . $color : '';
$size = ( '' !== $size && 'wpb_regularsize' !== $size ) ? ' wpb_' . $size : ' ' . $size;
$icon = ( '' !== $icon && 'none' !== $icon ) ? ' ' . $icon : '';
$i_icon = ( '' !== $icon ) ? ' <i class="icon"> </i>' : '';
$el_class = $this->getExtraClass( $el_class );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_button ' . $color . $size . $icon . $el_class, $this->settings['base'], $atts );
if ( '' !== $href ) {
$output .= '<span class="' . esc_attr( $css_class ) . '">' . $title . $i_icon . '</span>';
$output = '<a class="wpb_button_a' . esc_attr( $a_class ) . '" title="' . esc_attr( $title ) . '" href="' . esc_url( $href ) . '"' . $target . '>' . $output . '</a>';
} else {
$output .= '<button class="' . esc_attr( $css_class ) . '">' . $title . $i_icon . '</button>';
}
return $output;

View File

@@ -0,0 +1,52 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $link
* @var $title
* @var $color
* @var $size
* @var $style
* @var $el_class
* @var $align
* Shortcode class
* @var WPBakeryShortCode_Vc_Button2 $this
*/
$link = $title = $color = $size = $style = $el_class = $align = '';
$wrapper_start = $wrapper_end = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$class = 'vc_btn';
// parse link
$link = ( '||' === $link ) ? '' : $link;
$link = vc_build_link( $link );
$a_href = $link['url'];
$a_title = $link['title'];
$a_target = $link['target'];
$a_rel = $link['rel'];
if ( ! empty( $a_rel ) ) {
$a_rel = ' rel="' . esc_attr( trim( $a_rel ) ) . '"';
}
$class .= ( '' !== $color ) ? ( ' vc_btn_' . $color . ' vc_btn-' . $color ) : '';
$class .= ( '' !== $size ) ? ( ' vc_btn_' . $size . ' vc_btn-' . $size ) : '';
$class .= ( '' !== $style ) ? ' vc_btn_' . $style : '';
$el_class = $this->getExtraClass( $el_class );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, ' ' . $class . $el_class, $this->settings['base'], $atts );
$wrapper_css_class = 'vc_button-2-wrapper';
if ( $align ) {
$wrapper_css_class .= ' vc_button-2-align-' . $align;
}
$output = '';
$output .= '
<div class="' . esc_attr( $wrapper_css_class ) . '"><a class="' . esc_attr( trim( $css_class ) ) . '" href="' . esc_attr( $a_href ) . '" title="' . esc_attr( $a_title ) . '" target="' . esc_attr( $a_target ) . '"' . ( ! empty( $a_rel ) ? ' rel="' . esc_attr( trim( $a_rel ) ) . '"' : '' ) . '>';
$output .= $title;
$output .= '</a></div>';
return $output;

View File

@@ -0,0 +1,99 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $el_id
* @var $el_class
* @var $width
* @var $css
* @var $offset
* @var $content - shortcode content
* @var $css_animation
* Shortcode class
* @var WPBakeryShortCode_Vc_Column $this
*/
$el_class = $el_id = $width = $parallax_speed_bg = $parallax_speed_video = $parallax = $parallax_image = $video_bg = $video_bg_url = $video_bg_parallax = $css = $offset = $css_animation = '';
$output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
wp_enqueue_script( 'wpb_composer_front_js' );
$width = wpb_translateColumnWidthToSpan( $width );
$width = vc_column_offset_class_merge( $offset, $width );
$css_classes = array(
$this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation ),
'wpb_column',
'vc_column_container',
$width,
);
if ( vc_shortcode_custom_css_has_property( $css, array(
'border',
'background',
) ) || $video_bg || $parallax
) {
$css_classes[] = 'vc_col-has-fill';
}
$wrapper_attributes = array();
$has_video_bg = ( ! empty( $video_bg ) && ! empty( $video_bg_url ) && vc_extract_youtube_id( $video_bg_url ) );
$parallax_speed = $parallax_speed_bg;
if ( $has_video_bg ) {
$parallax = $video_bg_parallax;
$parallax_speed = $parallax_speed_video;
$parallax_image = $video_bg_url;
$css_classes[] = 'vc_video-bg-container';
wp_enqueue_script( 'vc_youtube_iframe_api_js' );
}
if ( ! empty( $parallax ) ) {
wp_enqueue_script( 'vc_jquery_skrollr_js' );
$wrapper_attributes[] = 'data-vc-parallax="' . esc_attr( $parallax_speed ) . '"'; // parallax speed
$css_classes[] = 'vc_general vc_parallax vc_parallax-' . $parallax;
if ( false !== strpos( $parallax, 'fade' ) ) {
$css_classes[] = 'js-vc_parallax-o-fade';
$wrapper_attributes[] = 'data-vc-parallax-o-fade="on"';
} elseif ( false !== strpos( $parallax, 'fixed' ) ) {
$css_classes[] = 'js-vc_parallax-o-fixed';
}
}
if ( ! empty( $parallax_image ) ) {
if ( $has_video_bg ) {
$parallax_image_src = $parallax_image;
} else {
$parallax_image_id = preg_replace( '/[^\d]/', '', $parallax_image );
$parallax_image_src = wp_get_attachment_image_src( $parallax_image_id, 'full' );
if ( ! empty( $parallax_image_src[0] ) ) {
$parallax_image_src = $parallax_image_src[0];
}
}
$wrapper_attributes[] = 'data-vc-parallax-image="' . esc_attr( $parallax_image_src ) . '"';
}
if ( ! $parallax && $has_video_bg ) {
$wrapper_attributes[] = 'data-vc-video-bg="' . esc_attr( $video_bg_url ) . '"';
}
$css_class = preg_replace( '/\s+/', ' ', apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, implode( ' ', array_filter( $css_classes ) ), $this->settings['base'], $atts ) );
$wrapper_attributes[] = 'class="' . esc_attr( trim( $css_class ) ) . '"';
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output .= '<div ' . implode( ' ', $wrapper_attributes ) . '>';
$innerColumnClass = 'vc_column-inner ' . esc_attr( trim( vc_shortcode_custom_css_class( $css ) ) );
$output .= '<div class="' . trim( $innerColumnClass ) . '">';
$output .= '<div class="wpb_wrapper">';
$output .= wpb_js_remove_wpautop( $content );
$output .= '</div>';
$output .= '</div>';
$output .= '</div>';
echo $output;

View File

@@ -0,0 +1,56 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $el_class
* @var $el_id
* @var $width
* @var $css
* @var $offset
* @var $content - shortcode content
* Shortcode class
* @var WPBakeryShortCode_Vc_Column_Inner $this
*/
$el_class = $width = $el_id = $css = $offset = '';
$output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$width = wpb_translateColumnWidthToSpan( $width );
$width = vc_column_offset_class_merge( $offset, $width );
$css_classes = array(
$this->getExtraClass( $el_class ),
'wpb_column',
'vc_column_container',
$width,
);
if ( vc_shortcode_custom_css_has_property( $css, array(
'border',
'background',
) ) ) {
$css_classes[] = 'vc_col-has-fill';
}
$wrapper_attributes = array();
$css_class = preg_replace( '/\s+/', ' ', apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, implode( ' ', array_filter( $css_classes ) ), $this->settings['base'], $atts ) );
$wrapper_attributes[] = 'class="' . esc_attr( trim( $css_class ) ) . '"';
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output .= '<div ' . implode( ' ', $wrapper_attributes ) . '>';
$innerColumnClass = 'vc_column-inner ' . esc_attr( trim( vc_shortcode_custom_css_class( $css ) ) );
$output .= '<div class="' . trim( $innerColumnClass ) . '">';
$output .= '<div class="wpb_wrapper">';
$output .= wpb_js_remove_wpautop( $content );
$output .= '</div>';
$output .= '</div>';
$output .= '</div>';
echo $output;

View File

@@ -0,0 +1,36 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $el_class
* @var $el_id
* @var $css_animation
* @var $css
* @var $content - shortcode content
* Shortcode class
* @var WPBakeryShortCode_Vc_Column_text $this
*/
$el_class = $el_id = $css = $css_animation = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$class_to_filter = 'wpb_text_column wpb_content_element ' . $this->getCSSAnimation( $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 );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '
<div class="' . esc_attr( $css_class ) . '" ' . implode( ' ', $wrapper_attributes ) . '>
<div class="wpb_wrapper">
' . wpb_js_remove_wpautop( $content, true ) . '
</div>
</div>
';
echo $output;

View File

@@ -0,0 +1,45 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $content - shortcode content
* Shortcode class
* @var WPBakeryShortCode_Vc_Cta $this
*/
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
$this->buildTemplate( $atts, $content );
$containerClass = trim( 'vc_cta3-container ' . esc_attr( implode( ' ', $this->getTemplateVariable( 'container-class' ) ) ) );
$cssClass = trim( 'vc_general ' . esc_attr( implode( ' ', $this->getTemplateVariable( 'css-class' ) ) ) );
$output = '';
$output .= '<section class="' . esc_attr( $containerClass ) . '"' . ( ! empty( $atts['el_id'] ) ? ' id="' . esc_attr( $atts['el_id'] ) . '"' : '' ) . '>';
$output .= '<div class="' . esc_attr( $cssClass ) . '"';
if ( $this->getTemplateVariable( 'inline-css' ) ) {
$output .= ' style="' . esc_attr( implode( ' ', $this->getTemplateVariable( 'inline-css' ) ) ) . '"';
}
$output .= '>'; // div
$output .= $this->getTemplateVariable( 'icons-top' );
$output .= $this->getTemplateVariable( 'icons-left' );
$output .= '<div class="vc_cta3_content-container">';
$output .= $this->getTemplateVariable( 'actions-top' );
$output .= $this->getTemplateVariable( 'actions-left' );
$output .= '<div class="vc_cta3-content">';
$output .= '<header class="vc_cta3-content-header">';
$output .= $this->getTemplateVariable( 'heading1' );
$output .= $this->getTemplateVariable( 'heading2' );
$output .= '</header>';
$output .= $this->getTemplateVariable( 'content' );
$output .= '</div>';
$output .= $this->getTemplateVariable( 'actions-bottom' );
$output .= $this->getTemplateVariable( 'actions-right' );
$output .= '</div>';
$output .= $this->getTemplateVariable( 'icons-bottom' );
$output .= $this->getTemplateVariable( 'icons-right' );
$output .= '</div></section>';
return $output;

View File

@@ -0,0 +1,73 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $color
* @var $icon
* @var $size
* @var $target
* @var $href
* @var $title
* @var $call_text
* @var $position
* @var $el_class
* @var $css_animation
* Shortcode class
* @var WPBakeryShortCode_Vc_Cta_button $this
*/
$color = $icon = $size = $target = $href = $target = $call_text = $position = $el_class = $css_animation = '';
$output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$el_class = $this->getExtraClass( $el_class );
if ( 'same' === $target || '_self' === $target ) {
$target = '';
}
if ( '' !== $target ) {
$target = ' target="' . esc_attr( $target ) . '"';
}
$icon = ( '' !== $icon && 'none' !== $icon ) ? ' ' . $icon : '';
$i_icon = ( '' !== $icon ) ? ' <i class="icon"> </i>' : '';
$color = ( '' !== $color ) ? ' wpb_' . $color : '';
$size = ( '' !== $size && 'wpb_regularsize' !== $size ) ? ' wpb_' . $size : ' ' . $size;
$a_class = '';
if ( '' !== $el_class ) {
$tmp_class = explode( ' ', $el_class );
if ( in_array( 'prettyphoto', $tmp_class, true ) ) {
wp_enqueue_script( 'prettyphoto' );
wp_enqueue_style( 'prettyphoto' );
$a_class .= ' prettyphoto';
$el_class = str_ireplace( 'prettyphoto', '', $el_class );
}
}
if ( '' !== $href ) {
$button = '<span class="wpb_button ' . esc_attr( $color . $size . $icon ) . '">' . $title . $i_icon . '</span>';
$button = '<a class="wpb_button_a' . esc_attr( $a_class ) . '" href="' . esc_url( $href ) . '"' . $target . '>' . $button . '</a>';
} else {
$button = '';
$el_class .= ' cta_no_button';
}
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_call_to_action wpb_content_element vc_clearfix ' . $position . $el_class, $this->settings['base'], $atts );
$css_class .= $this->getCSSAnimation( $css_animation );
$output .= '<div class="' . esc_attr( $css_class ) . '">';
if ( 'cta_align_bottom' !== $position ) {
$output .= $button;
}
$output .= apply_filters( 'wpb_cta_text', '<h2 class="wpb_call_text">' . $call_text . '</h2>', array( 'content' => $call_text ) );
if ( 'cta_align_bottom' === $position ) {
$output .= $button;
}
$output .= '</div>';
return $output;

View File

@@ -0,0 +1,68 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $h2
* @var $h4
* @var $position
* @var $el_width
* @var $style
* @var $txt_align
* @var $accent_color
* @var $link
* @var $title
* @var $color
* @var $size
* @var $btn_style
* @var $el_class
* @var $css_animation
* @var $content - shortcode content
* Shortcode class
* @var WPBakeryShortCode_Vc_Cta_button2 $this
*/
$h2 = $h4 = $position = $el_class = $el_width = $size = $txt_align = $accent_color = $link = $title = $color = $size = $btn_style = $css_animation = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$class = 'vc_call_to_action wpb_content_element';
$link = ( '||' === $link ) ? '' : $link;
$class .= ( '' !== $position ) ? ' vc_cta_btn_pos_' . $position : '';
$class .= ( '' !== $el_width ) ? ' vc_el_width_' . $el_width : '';
$class .= ( '' !== $color ) ? ' vc_cta_' . $color : '';
$class .= ( '' !== $style ) ? ' vc_cta_' . $style : '';
$class .= ( '' !== $txt_align ) ? ' vc_txt_align_' . $txt_align : '';
$inline_css = ( '' !== $accent_color ) ? ' style="' . vc_get_css_color( 'background-color', $accent_color ) . vc_get_css_color( 'border-color', $accent_color ) . '"' : '';
$class .= $this->getExtraClass( $el_class );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class, $this->settings['base'], $atts );
$css_class .= $this->getCSSAnimation( $css_animation );
$output = '';
$output .= '<div ' . $inline_css . ' class="' . esc_attr( trim( $css_class ) ) . '">';
if ( '' !== $link && 'bottom' !== $position ) {
$output .= do_shortcode( '[vc_button2 align="' . $position . '" link="' . $link . '" title="' . $title . '" color="' . $color . '" size="' . $size . '" style="' . $btn_style . '" el_class="vc_cta_btn"]' );
}
if ( '' !== $h2 || '' !== $h4 ) {
$output .= '<hgroup>';
if ( '' !== $h2 ) {
$output .= '<h2 class="wpb_heading">' . $h2 . '</h2>';
}
if ( '' !== $h4 ) {
$output .= '<h4 class="wpb_heading">' . $h4 . '</h4>';
}
$output .= '</hgroup>';
}
$output .= wpb_js_remove_wpautop( $content, true );
if ( '' !== $link && 'bottom' === $position ) {
$output .= do_shortcode( '[vc_button2 link="' . $link . '" title="' . $title . '" color="' . $color . '" size="' . $size . '" style="' . $btn_style . '" el_class="vc_cta_btn"]' );
}
$output .= '</div>';
echo $output;

View File

@@ -0,0 +1,26 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @var array $atts
* @var string $field_key
* @var string $custom_field_key
* @var string $el_class
*/
$field_key = $custom_field_key = $el_class = '';
extract( shortcode_atts( array(
'field_key' => '',
'custom_field_key' => '',
'el_class' => '',
), $atts ) );
$key = strlen( $custom_field_key ) > 0 ? $custom_field_key : $field_key;
$output = '';
if ( strlen( $key ) ) {
$output .= '<div class="vc_gitem-custom-field-' . esc_attr( $key ) . '">{{ post_meta_value: ' . esc_attr( $key ) . '}}</div>';
}
return $output;

View File

@@ -0,0 +1,77 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $source
* @var $text
* @var $link
* @var $google_fonts
* @var $font_container
* @var $el_class
* @var $el_id
* @var $css
* @var $css_animation
* @var $font_container_data - returned from $this->getAttributes
* @var $google_fonts_data - returned from $this->getAttributes
* Shortcode class
* @var WPBakeryShortCode_Vc_Custom_heading $this
*/
$source = $text = $link = $google_fonts = $font_container = $el_id = $el_class = $css = $css_animation = $font_container_data = $google_fonts_data = array();
// This is needed to extract $font_container_data and $google_fonts_data
extract( $this->getAttributes( $atts ) );
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
/**
* @var $css_class
*/
extract( $this->getStyles( $el_class . $this->getCSSAnimation( $css_animation ), $css, $google_fonts_data, $font_container_data, $atts ) );
$settings = get_option( 'wpb_js_google_fonts_subsets' );
if ( is_array( $settings ) && ! empty( $settings ) ) {
$subsets = '&subset=' . implode( ',', $settings );
} else {
$subsets = '';
}
if ( ( ! isset( $atts['use_theme_fonts'] ) || 'yes' !== $atts['use_theme_fonts'] ) && isset( $google_fonts_data['values']['font_family'] ) ) {
wp_enqueue_style( 'vc_google_fonts_' . vc_build_safe_css_class( $google_fonts_data['values']['font_family'] ), 'https://fonts.googleapis.com/css?family=' . $google_fonts_data['values']['font_family'] . $subsets, [], WPB_VC_VERSION );
}
if ( ! empty( $styles ) ) {
$style = 'style="' . esc_attr( implode( ';', $styles ) ) . '"';
} else {
$style = '';
}
if ( 'post_title' === $source ) {
$text = get_the_title( get_the_ID() );
}
if ( ! empty( $link ) ) {
$link = vc_build_link( $link );
$text = '<a href="' . esc_url( $link['url'] ) . '"' . ( $link['target'] ? ' target="' . esc_attr( $link['target'] ) . '"' : '' ) . ( $link['rel'] ? ' rel="' . esc_attr( $link['rel'] ) . '"' : '' ) . ( $link['title'] ? ' title="' . esc_attr( $link['title'] ) . '"' : '' ) . '>' . $text . '</a>';
}
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '';
if ( apply_filters( 'vc_custom_heading_template_use_wrapper', false ) ) {
$output .= '<div class="' . esc_attr( $css_class ) . '" ' . implode( ' ', $wrapper_attributes ) . '>';
$output .= '<' . $font_container_data['values']['tag'] . ' ' . $style . ' >';
$output .= $text;
$output .= '</' . $font_container_data['values']['tag'] . '>';
$output .= '</div>';
} else {
$output .= '<' . $font_container_data['values']['tag'] . ' ' . $style . ' class="' . esc_attr( $css_class ) . '" ' . implode( ' ', $wrapper_attributes ) . '>';
$output .= $text;
$output .= '</' . $font_container_data['values']['tag'] . '>';
}
return $output;

View File

@@ -0,0 +1,40 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $height
* @var $el_class
* @var $el_id
* @var $css
* Shortcode class
* @var WPBakeryShortCode_Vc_Empty_space $this
*/
$height = $el_class = $el_id = $css = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$pattern = '/^(\d*(?:\.\d+)?)\s*(px|\%|in|cm|mm|em|rem|ex|pt|pc|vw|vh|vmin|vmax)?$/';
// allowed metrics: https://www.w3schools.com/cssref/css_units.asp
$regexr = preg_match( $pattern, $height, $matches );
$value = isset( $matches[1] ) ? (float) $matches[1] : (float) WPBMap::getParam( 'vc_empty_space', 'height' );
$unit = isset( $matches[2] ) ? $matches[2] : 'px';
$height = $value . $unit;
$inline_css = ( (float) $height >= 0.0 ) ? ' style="height: ' . esc_attr( $height ) . '"' : '';
$class = 'vc_empty_space ' . $this->getExtraClass( $el_class ) . vc_shortcode_custom_css_class( $css, ' ' );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class, $this->settings['base'], $atts );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '';
$output .= '<div class="' . esc_attr( trim( $css_class ) ) . '" ';
$output .= implode( ' ', $wrapper_attributes ) . ' ' . $inline_css;
$output .= '><span class="vc_empty_space_inner"></span></div>';
return $output;

View File

@@ -0,0 +1,36 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $type
* @var $el_class
* @var $el_id
* @var $css
* @var $css_animation
* Shortcode class
* @var WPBakeryShortCode_Vc_Facebook $this
*/
$type = $css = $el_class = $el_id = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$url = get_permalink();
$el_class = isset( $el_class ) ? $el_class : '';
$class_to_filter = 'fb_like wpb_content_element fb_type_' . $type;
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' ) . $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '<div class="' . esc_attr( $css_class ) . '" ' . implode( ' ', $wrapper_attributes ) . '><iframe src="https://www.facebook.com/plugins/like.php?href='
. esc_url( $url ) . '&amp;layout='
. esc_attr( $type ) . '&amp;show_faces=false&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true"></iframe></div>';
return $output;

View File

@@ -0,0 +1,47 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $el_class
* @var $el_id
* @var $title
* @var $flickr_id
* @var $count
* @var $type
* @var $display
* @var $css
* @var $css_animation
* Shortcode class
* @var WPBakeryShortCode_Vc_flickr $this
*/
$el_class = $el_id = $title = $flickr_id = $css = $css_animation = $count = $type = $display = '';
$output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$class_to_filter = 'wpb_flickr_widget wpb_content_element';
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' ) . $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$custom_tag = 'script';
// @codingStandardsIgnoreStarts
$output = '
<div class="' . esc_attr( $css_class ) . '" ' . implode( ' ', $wrapper_attributes ) . '>
<div class="wpb_wrapper">
' . wpb_widget_title( array(
'title' => $title,
'extraclass' => 'wpb_flickr_heading',
) ) . '<' . $custom_tag . ' src="https://www.flickr.com/badge_code_v2.gne?count=' . esc_attr( $count ) . '&amp;display=' . esc_attr( $display ) . '&amp;size=s&amp;layout=x&amp;source=' . esc_attr( $type ) . '&amp;' . esc_attr( $type ) . '=' . esc_attr( $flickr_id ) . '"></' . $custom_tag . '>
<p class="flickr_stream_wrap"><a class="wpb_follow_btn wpb_flickr_stream" href="https://www.flickr.com/photos/' . esc_attr( $flickr_id ) . '">' . esc_html__( 'View stream on flickr', 'js_composer' ) . '</a></p>
</div>
</div>
';
return $output;

View File

@@ -0,0 +1,175 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $source
* @var $type
* @var $onclick
* @var $custom_links
* @var $custom_links_target
* @var $img_size
* @var $external_img_size
* @var $images
* @var $custom_srcs
* @var $el_class
* @var $el_id
* @var $interval
* @var $css
* @var $css_animation
* Shortcode class
* @var WPBakeryShortCode_Vc_gallery $this
*/
$thumbnail = '';
$title = $source = $type = $onclick = $custom_links = $custom_links_target = $img_size = $external_img_size = $images = $custom_srcs = $el_class = $el_id = $interval = $css = $css_animation = '';
$large_img_src = '';
$attributes = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $attributes );
$default_src = vc_asset_url( 'vc/no_image.png' );
$gal_images = '';
$link_start = '';
$link_end = '';
$el_start = '';
$el_end = '';
$slides_wrap_start = '';
$slides_wrap_end = '';
$el_class = $this->getExtraClass( $el_class );
if ( 'nivo' === $type ) {
$type = ' wpb_slider_nivo theme-default';
wp_enqueue_script( 'nivo-slider' );
wp_enqueue_style( 'nivo-slider-css' );
wp_enqueue_style( 'nivo-slider-theme' );
$slides_wrap_start = '<div class="nivoSlider">';
$slides_wrap_end = '</div>';
} elseif ( 'flexslider' === $type || 'flexslider_fade' === $type || 'flexslider_slide' === $type || 'fading' === $type ) {
$el_start = '<li>';
$el_end = '</li>';
$slides_wrap_start = '<ul class="slides">';
$slides_wrap_end = '</ul>';
wp_enqueue_style( 'flexslider' );
wp_enqueue_script( 'flexslider' );
} elseif ( 'image_grid' === $type ) {
wp_enqueue_script( 'vc_grid-js-imagesloaded' );
wp_enqueue_script( 'isotope' );
wp_enqueue_style( 'isotope-css' );
$el_start = '<li class="isotope-item">';
$el_end = '</li>';
$slides_wrap_start = '<ul class="wpb_image_grid_ul">';
$slides_wrap_end = '</ul>';
}
if ( 'link_image' === $onclick ) {
wp_enqueue_script( 'prettyphoto' );
wp_enqueue_style( 'prettyphoto' );
}
$flex_fx = '';
if ( 'flexslider' === $type || 'flexslider_fade' === $type || 'fading' === $type ) {
$type = ' wpb_flexslider flexslider_fade flexslider';
$flex_fx = ' data-flex_fx="fade"';
} elseif ( 'flexslider_slide' === $type ) {
$type = ' wpb_flexslider flexslider_slide flexslider';
$flex_fx = ' data-flex_fx="slide"';
} elseif ( 'image_grid' === $type ) {
$type = ' wpb_image_grid';
}
if ( '' === $images ) {
$images = '-1,-2,-3';
}
$pretty_rel_random = ' data-rel="prettyPhoto[rel-' . get_the_ID() . '-' . wp_rand() . ']"';
if ( 'custom_link' === $onclick ) {
$custom_links = vc_value_from_safe( $custom_links );
$custom_links = explode( ',', $custom_links );
}
switch ( $source ) {
case 'media_library':
$images = explode( ',', $images );
break;
case 'external_link':
$images = vc_value_from_safe( $custom_srcs );
$images = explode( ',', $images );
break;
}
foreach ( $images as $i => $image ) {
switch ( $source ) {
case 'media_library':
if ( $image > 0 ) {
$img = wpb_getImageBySize( array(
'attach_id' => $image,
'thumb_size' => $img_size,
) );
$thumbnail = $img['thumbnail'];
$large_img_src = $img['p_img_large'][0];
} else {
$large_img_src = $default_src;
$thumbnail = '<img src="' . esc_url( $default_src ) . '" />';
}
break;
case 'external_link':
$dimensions = vc_extract_dimensions( $external_img_size );
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
$thumbnail = '<img ' . $hwstring . ' src="' . esc_url( $image ) . '" />';
$large_img_src = $image;
break;
}
$link_start = $link_end = '';
switch ( $onclick ) {
case 'img_link_large':
$link_start = '<a href="' . esc_url( $large_img_src ) . '" target="' . $custom_links_target . '">';
$link_end = '</a>';
break;
case 'link_image':
$link_start = '<a class="prettyphoto" href="' . esc_url( $large_img_src ) . '"' . $pretty_rel_random . '>';
$link_end = '</a>';
break;
case 'custom_link':
if ( ! empty( $custom_links[ $i ] ) ) {
$link_start = '<a href="' . esc_url( $custom_links[ $i ] ) . '"' . ( ! empty( $custom_links_target ) ? ' target="' . $custom_links_target . '"' : '' ) . '>';
$link_end = '</a>';
}
break;
}
$gal_images .= $el_start . $link_start . $thumbnail . $link_end . $el_end;
}
$class_to_filter = 'wpb_gallery wpb_content_element vc_clearfix';
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' ) . $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '';
$output .= '<div class="' . $css_class . '" ' . implode( ' ', $wrapper_attributes ) . '>';
$output .= '<div class="wpb_wrapper">';
$output .= wpb_widget_title( array(
'title' => $title,
'extraclass' => 'wpb_gallery_heading',
) );
$output .= '<div class="wpb_gallery_slides' . $type . '" data-interval="' . $interval . '"' . $flex_fx . '>' . $slides_wrap_start . $gal_images . $slides_wrap_end . '</div>';
$output .= '</div>';
$output .= '</div>';
return $output;

View File

@@ -0,0 +1,46 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $el_class
* @var $width
* @var $is_end
* @var $css
* @var $c_zone_position
* @var $bgimage
* @var $height
* @var $content - shortcode content
* Shortcode class
* @var WPBakeryShortCode_Vc_Gitem $this
*/
$el_class = $width = $is_end = $css = $c_zone_position = $bgimage = $height = '';
extract( shortcode_atts( array(
'el_class' => '',
'width' => '12',
'is_end' => '',
'css' => '',
'c_zone_position' => '',
'bgimage' => '',
'height' => '',
), $atts ) );
$css_class = 'vc_grid-item vc_clearfix' . ( 'true' === $is_end ? ' vc_grid-last-item' : '' ) . ( strlen( $el_class ) ? ' ' . $el_class : '' ) . ' vc_col-sm-' . $width . ( ! empty( $c_zone_position ) ? ' vc_grid-item-zone-c-' . $c_zone_position : '' );
$css_class_mini = 'vc_grid-item-mini vc_clearfix ' . vc_shortcode_custom_css_class( $css, ' ' );
$css_class .= '{{ filter_terms_css_classes }}';
$css_style = '';
if ( 'featured' === $bgimage ) {
$css_style = 'background-image: url(\'{{ post_image_url }}\');';
$css_class .= ' vc_grid-item-background-cover';
}
if ( strlen( $height ) > 0 ) {
$css_style .= 'height: ' . $height . ';';
}
$output = '<div class="' . esc_attr( $css_class ) . '"' . ( empty( $css_style ) ? '' : ' style="' . esc_attr( $css_style ) . '"' ) . '><div class="' . esc_attr( $css_class_mini ) . '">' . do_shortcode( $content ) . '</div><div class="vc_clearfix"></div></div>';
echo $output;

View File

@@ -0,0 +1,36 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $css
* @var $animation
* @var $content - shortcode content
* Shortcode class
* @var WPBakeryShortCode_Vc_Gitem_Animated_Block $this
*/
$css = $animation = $animation_attr = '';
extract( shortcode_atts( array(
'css' => '',
// unmapped
'animation' => '',
), $atts ) );
$css_style = '';
$css_class = 'vc_gitem-animated-block ' . vc_shortcode_custom_css_class( $css, ' ' );
if ( ! empty( $animation ) ) {
$css_class .= ' vc_gitem-animate vc_gitem-animate-' . $animation;
$animation_attr .= ' data-vc-animation="' . esc_attr( $animation ) . '"';
} elseif ( 'vc_gitem_preview' !== vc_request_param( 'action' ) && vc_verify_admin_nonce() && ( current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ) ) ) {
$content = preg_replace( '/(?<=\[)(vc_gitem_zone_b\b)/', '$1 render="no"', $content );
}
$output = '';
$output .= '<div class="' . esc_attr( $css_class ) . '" ' . $animation_attr . ( empty( $css_style ) ? '' : ' style="' . esc_attr( $css_style ) ) . '">';
$output .= do_shortcode( $content );
$output .= '</div>';
echo $output;

View File

@@ -0,0 +1,27 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $el_class
* @var $background_color
* @var $float
* @var $content - shortcode content
* Shortcode class
* @var WPBakeryShortCode_Vc_Gitem $this
*/
$el_class = $background_color = $float = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
if ( ! empty( $background_color ) ) {
$background_color = ' vc_bg-' . $background_color;
}
$output = '<div class="vc_gitem-block' . esc_attr( $background_color ) . ( strlen( $el_class ) > 0 ? ' ' . esc_attr( $el_class ) : '' ) . ' vc_gitem-float-' . esc_attr( $float ) . '">' . do_shortcode( $content ) . '</div>';
echo $output;

View File

@@ -0,0 +1,35 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $width
* @var $align
* @var $css
* @var $el_class
* @var $featured_image
* @var $img_size
* @var $content - shortcode content
* Shortcode class
* @var WPBakeryShortCode_Vc_Gitem_Col $this
*/
$width = $align = $css = $el_class = $featured_image = $img_size = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
// TODO: Note that vc_map_get_attributes doesnt return align so it should be checked in next bug fix
$style = '';
$width = wpb_translateColumnWidthToSpan( $width );
$css_class = $width . ( strlen( $el_class ) ? ' ' . $el_class : '' ) . ' vc_gitem-col vc_gitem-col-align-' . $align . vc_shortcode_custom_css_class( $css, ' ' );
if ( 'yes' === $featured_image ) {
$style = '{{ post_image_background_image_css' . ':' . esc_attr( $img_size ) . ' }}';
}
$output = '<div class="' . esc_attr( $css_class ) . '"' . ( strlen( $style ) > 0 ? ' style="' . esc_attr( $style ) . '"' : '' ) . '>' . do_shortcode( $content ) . '</div>';
echo $output;

View File

@@ -0,0 +1,6 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
return '{{ featured_image: ' . http_build_query( $atts ) . ' }}';

View File

@@ -0,0 +1,49 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* Shortcode class
* @var WPBakeryShortCode_Vc_Gitem_Post_Author $this
*/
$atts = $this->getAttributes( $atts );
$styles = $this->getStyles( $atts['el_class'], $atts['css'], $atts['google_fonts_data'], $atts['font_container_data'], $atts );
if ( ! empty( $atts['link'] ) ) {
$atts['link'] = 'post_author';
$link_html = vc_gitem_create_link( $atts );
}
$use_custom_fonts = isset( $atts['use_custom_fonts'] ) && 'yes' === $atts['use_custom_fonts'];
$settings = get_option( 'wpb_js_google_fonts_subsets' );
$subsets = '';
if ( is_array( $settings ) && ! empty( $settings ) ) {
$subsets = '&subset=' . implode( ',', $settings );
}
$content = '{{ post_author }}';
if ( ! empty( $link_html ) ) {
$content = '<' . $link_html . '>' . $content . '</a>';
}
$css_class = array(
$styles['css_class'],
'vc_gitem-post-data',
);
$css_class[] = 'vc_gitem-post-data-source-post_author';
if ( $use_custom_fonts && ! empty( $atts['google_fonts_data'] ) && isset( $atts['google_fonts_data']['values']['font_family'] ) ) {
wp_enqueue_style( 'vc_google_fonts_' . vc_build_safe_css_class( $atts['google_fonts_data']['values']['font_family'] ), 'https://fonts.googleapis.com/css?family=' . $atts['google_fonts_data']['values']['font_family'] . $subsets, [], WPB_VC_VERSION );
}
$output .= '<div class="' . esc_attr( implode( ' ', $css_class ) ) . '" >';
$style = '';
if ( ! empty( $styles['styles'] ) ) {
$style = 'style="' . esc_attr( implode( ';', $styles['styles'] ) ) . '"';
}
$output .= '<' . $atts['font_container_data']['values']['tag'] . ' ' . $style . ' >';
$output .= $content;
$output .= '</' . $atts['font_container_data']['values']['tag'] . '>';
$output .= '</div>';
return $output;

View File

@@ -0,0 +1,15 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* Shortcode class
* @var WPBakeryShortCode_Vc_Gitem_Post_Categories $this
*/
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
return '{{ post_categories:' . http_build_query( array( 'atts' => $atts ) ) . ' }}';

View File

@@ -0,0 +1,50 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* Shortcode class
* @var WPBakeryShortCode_Vc_Gitem_Post_Data $this
*/
$output = $text = $google_fonts = $font_container = $el_class = $css = $link_html = '';
$font_container_data = array();
$google_fonts_data = array();
extract( $this->getAttributes( $atts ) );
extract( $this->getStyles( $el_class, $css, $google_fonts_data, $font_container_data, $atts ) );
$data_source = $this->getDataSource( $atts );
if ( isset( $atts['link'] ) && '' !== $atts['link'] && 'none' !== $atts['link'] ) {
$link_html = vc_gitem_create_link( $atts );
}
$use_custom_fonts = isset( $atts['use_custom_fonts'] ) && 'yes' === $atts['use_custom_fonts'];
$settings = get_option( 'wpb_js_google_fonts_subsets' );
$subsets = '';
if ( is_array( $settings ) && ! empty( $settings ) ) {
$subsets = '&subset=' . implode( ',', $settings );
}
$content = '{{ post_data:' . esc_attr( $data_source ) . ' }}';
if ( ! empty( $link_html ) ) {
$content = '<' . $link_html . '>' . $content . '</a>';
}
$css_class .= ' vc_gitem-post-data';
if ( $data_source ) {
$css_class .= ' vc_gitem-post-data-source-' . $data_source;
}
if ( $use_custom_fonts && ! empty( $google_fonts_data ) && isset( $google_fonts_data['values']['font_family'] ) ) {
wp_enqueue_style( 'vc_google_fonts_' . vc_build_safe_css_class( $google_fonts_data['values']['font_family'] ), 'https://fonts.googleapis.com/css?family=' . $google_fonts_data['values']['font_family'] . $subsets, [], WPB_VC_VERSION );
}
$output .= '<div class="' . esc_attr( $css_class ) . '" >';
$style = '';
if ( ! empty( $styles ) ) {
$style = 'style="' . esc_attr( implode( ';', $styles ) ) . '"';
}
$output .= '<' . $font_container_data['values']['tag'] . ' ' . $style . ' >';
$output .= $content;
$output .= '</' . $font_container_data['values']['tag'] . '>';
$output .= '</div>';
return $output;

View File

@@ -0,0 +1,33 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $key
* @var $el_class
* @var $align
* @var $label
* Shortcode class
* @var WPBakeryShortCode_Vc_Gitem_Post_Meta $this
*/
$key = $el_class = $align = $label = '';
$label_html = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$css_class = 'vc_gitem-post-meta-field-' . $key . ( strlen( $el_class ) ? ' ' . $el_class : '' ) . ( strlen( $align ) ? ' vc_gitem-align-' . $align : '' );
if ( strlen( $label ) ) {
$label_html = '<span class="vc_gitem-post-meta-label">' . esc_html( $label ) . '</span>';
}
$output = '';
if ( strlen( $key ) ) {
$output .= '<div class="' . esc_attr( $css_class ) . '">';
$output .= $label_html;
$output .= '{{ post_meta_value:' . esc_attr( $key ) . ' }}';
$output .= '</div>';
}
return $output;

View File

@@ -0,0 +1,30 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $css
* @var $el_class
* @var $position
* @var $content - shortcode content
* Shortcode class
* @var WPBakeryShortCode_Vc_Gitem_Row $this
*/
$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;
}
$output = '<div class="' . esc_attr( $css_class ) . '">' . do_shortcode( $content ) . '</div>';
echo $output;

View File

@@ -0,0 +1,92 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $el_class
* @var $css
* @var $position
* @var $bgimage
* @var $height
* @var $link
* @var $url
* @var $height_mode
* @var $featured_image
* @var $img_size
* @var $render
* @var $content - shortcode content
* Shortcode class
* @var WPBakeryShortCode_Vc_Gitem_Zone $this
*/
$el_class = $css = $position = $bgimage = $height = $link = $url = $height_mode = $featured_image = $img_size = $render = $rel = '';
$css_style = $css_style_mini = '';
$image_block = $image = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
if ( 'no' === $render ) {
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
// https://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';
}
$css_style .= 'height: ' . $height . ';';
}
} elseif ( 'original' !== $height_mode ) {
$css_class .= ' vc-gitem-zone-height-mode-auto' . ( strlen( $height_mode ) > 0 ? ' vc-gitem-zone-height-mode-auto-' . $height_mode : '' );
}
if ( 'yes' === $featured_image ) {
$css_style .= '{{ post_image_background_image_css' . ':' . $img_size . ' }}';
$image = '<img src="{{ post_image_url' . ( false !== $background_image_css_editor ? ':' . rawurlencode( $background_image_css_editor ) . '' : ':' ) . ':' . $img_size . ' }}" class="vc_gitem-zone-img" alt="{{ post_image_alt }}">';
} elseif ( false !== $background_image_css_editor ) {
$image = '<img src="' . esc_url( $background_image_css_editor ) . '" class="vc_gitem-zone-img" alt="{{ post_image_alt }}">';
}
if ( strlen( $link ) > 0 && 'none' !== $link ) {
$css_class .= ' vc_gitem-is-link';
if ( 'custom' === $link && ! empty( $url ) ) {
$link_s = vc_build_link( $url );
$rel = '';
if ( ! empty( $link_s['rel'] ) ) {
$rel = ' rel="' . esc_attr( trim( $link_s['rel'] ) ) . '"';
}
$image_block = '<a href="' . esc_url( $link_s['url'] ) . '" title="' . esc_attr( $link_s['title'] ) . '" target="' . esc_attr( trim( $link_s['target'] ) ) . '" class="vc_gitem-link vc-zone-link"' . $rel . '></a>';
} elseif ( 'post_link' === $link ) {
$image_block = '<a href="{{ post_link_url }}" title="{{ post_title }}" class="vc_gitem-link vc-zone-link"></a>';
} elseif ( 'post_author' === $link ) {
$image_block = '<a href="{{ post_author_href }}" title="{{ post_author }}" class="vc_gitem-link vc-zone-link"></a>';
} elseif ( 'image' === $link ) {
$image_block = '<a href="{{ post_image_url }}" title="{{ post_title }}" class="vc_gitem-link vc-zone-link"></a>';
} elseif ( 'image_lightbox' === $link ) {
if ( ! isset( $this->prettyphoto_rel ) ) {
$this->prettyphoto_rel = ' data-rel="prettyPhoto[rel-' . get_the_ID() . '-' . wp_rand() . ']"';
}
$image_block .= '<a href="{{ post_image_url }}" title="{{ post_title }}" ' . $this->prettyphoto_rel . ' data-vc-gitem-zone="prettyphotoLink" class="vc_gitem-link prettyphoto vc-zone-link vc-prettyphoto-link"></a>';
}
$image_block = apply_filters( 'vc_gitem_zone_image_block_link', $image_block, $link, 'vc_gitem-link vc-zone-link' );
}
$output = '';
$output .= '<div class="' . esc_attr( $css_class ) . '"';
$output .= ( empty( $css_style ) ? '' : ' style="' . esc_attr( $css_style ) . '"' );
$output .= '>';
$output .= $image_block . $image;
$output .= '<div class="' . esc_attr( $css_class_mini ) . '"' . ( empty( $css_style_mini ) ? '' : ' style="' . esc_attr( $css_style_mini ) . '"' ) . '>' . do_shortcode( $content ) . '</div></div>';
echo $output;

View File

@@ -0,0 +1,35 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $el_class
* @var $css
* @var $render
* @var $content - shortcode content
* Shortcode class
* @var WPBakeryShortCode_Vc_Gitem_Zone $this
*/
$el_class = $css = $render = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
extract( $atts );
if ( 'no' === $render ) {
echo '';
return;
}
$css_class = 'vc_gitem-zone' . ( strlen( $this->zone_name ) ? ' vc_gitem-zone-' . $this->zone_name : '' ) . $this->getExtraClass( $el_class );
$css_class_mini = 'vc_gitem-zone-mini';
$css_class .= vc_shortcode_custom_css_class( $css, ' ' );
$output = '';
$output .= '<div class="' . esc_attr( $css_class ) . '"><div class="' . esc_attr( $css_class_mini ) . '">' . do_shortcode( $content ) . '</div></div>';
echo $output;

View File

@@ -0,0 +1,63 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $link
* @var $size
* @var $el_class
* @var $el_id
* @var $css
* @var $css_animation
* Shortcode class
* @var WPBakeryShortCode_Vc_Gmaps $this
*/
$title = $link = $size = $el_class = $css = $css_animation = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$zoom = 14; // deprecated 4.0.2. In 4.6 was moved outside from shortcode_atts
$type = 'm'; // deprecated 4.0.2
$bubble = ''; // deprecated 4.0.2
if ( '' === $link ) {
return null;
}
$link = trim( vc_value_from_safe( $link ) );
$bubble = ( '' !== $bubble && '0' !== $bubble ) ? '&amp;iwloc=near' : '';
$size = str_replace( array(
'px',
' ',
), array(
'',
'',
), $size );
if ( is_numeric( $size ) ) {
$link = preg_replace( '/height="[0-9]*"/', 'height="' . $size . '"', $link );
}
$class_to_filter = 'wpb_gmaps_widget wpb_content_element' . ( '' === $size ? ' vc_map_responsive' : '' );
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' ) . $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
$output = '';
$output .= '<div class="' . esc_attr( $css_class ) . '"' . ( ! empty( $el_id ) ? ' id="' . esc_attr( $el_id ) . '"' : '' ) . '>';
$output .= wpb_widget_title( array(
'title' => $title,
'extraclass' => 'wpb_map_heading',
) );
$output .= '<div class="wpb_wrapper"><div class="wpb_map_wraper">';
if ( preg_match( '/^\<iframe/', $link ) ) {
$output .= $link;
} else {
// TODO: refactor or remove outdated/deprecated attributes that is not mapped in gmaps.
$output .= '<iframe width="100%" height="' . esc_attr( $size ) . '" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="' . esc_url( $link ) . '&amp;t=' . esc_attr( $type ) . '&amp;z=' . esc_attr( $zoom ) . '&amp;output=embed' . esc_attr( $bubble ) . '"></iframe>';
}
$output .= '</div></div></div>';
return $output;

View File

@@ -0,0 +1,46 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $type
* @var $el_class
* @var $el_id
* @var $annotation
* @var $widget_width
* @var $css
* @var $css_animation
* Shortcode class
* @var WPBakeryShortCode_Vc_GooglePlus $this
*/
$type = $annotation = $widget_width = $css = $el_class = $el_id = $css_animation = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
if ( empty( $annotation ) ) {
$annotation = 'bubble';
}
$params = '';
$params .= ( '' !== $type ) ? ' size="' . $type . '"' : '';
$params .= ( '' !== $annotation ) ? ' annotation="' . $annotation . '"' : '';
if ( empty( $type ) ) {
$type = 'standard';
}
if ( 'inline' === $annotation && strlen( $widget_width ) > 0 ) {
$params .= ' width="' . (int) $widget_width . '"';
}
$class_to_filter = 'wpb_googleplus wpb_content_element wpb_googleplus_type_' . $type . ' vc_googleplus-annotation-' . $annotation . $this->getCSSAnimation( $css_animation ) . $this->getExtraClass( $el_class );
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '<div class="' . esc_attr( $css_class ) . '" ' . implode( ' ', $wrapper_attributes ) . '><g:plusone' . $params . '></g:plusone></div>';
return $output;

View File

@@ -0,0 +1,36 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $el_class
* @var $el_id
* @var $css_animation
* @var $css
* @var $content - shortcode content
* Shortcode class
* @var WPBakeryShortCode_Vc_Gutenberg $this
*/
$el_class = $el_id = $css = $css_animation = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$class_to_filter = 'vc_gutenberg wpb_content_element ' . $this->getCSSAnimation( $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 );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '
<div class="' . esc_attr( $css_class ) . '" ' . implode( ' ', $wrapper_attributes ) . '>
<div class="wpb_wrapper">
' . wpb_js_remove_wpautop( $content, true ) . '
</div>
</div>
';
return $output;

View File

@@ -0,0 +1,72 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @var \WPBakeryShortCode_Vc_Hoverbox $this
* @var array $atts
* @var string $content
*/
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
if ( ! empty( $atts['image'] ) ) {
$image = intval( $atts['image'] );
$image_data = wp_get_attachment_image_src( $image, 'large' );
$image_src = $image_data[0];
} else {
$image_src = vc_asset_url( 'vc/no_image.png' );
}
$image_src = esc_url( $image_src );
$align = 'vc-hoverbox-align--' . esc_attr( $atts['align'] );
$shape = 'vc-hoverbox-shape--' . esc_attr( $atts['shape'] );
$width = 'vc-hoverbox-width--' . esc_attr( $atts['el_width'] );
$reverse = 'vc-hoverbox-direction--default';
if ( ! empty( $atts['reverse'] ) ) {
$reverse = 'vc-hoverbox-direction--reverse';
}
$id = '';
if ( ! empty( $atts['el_id'] ) ) {
$id = 'id="' . esc_attr( $atts['el_id'] ) . '"';
}
$class_to_filter = vc_shortcode_custom_css_class( $atts['css'], ' ' ) . $this->getExtraClass( $atts['el_class'] ) . $this->getCSSAnimation( $atts['css_animation'] );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
// Hover Background color
if ( 'custom' !== $atts['hover_background_color'] ) {
$hover_background_color = vc_convert_vc_color( $atts['hover_background_color'] );
} else {
$hover_background_color = esc_attr( $atts['hover_custom_background'] );
}
$primary_title = $this->getHeading( 'primary_title', $atts, $atts['primary_align'] );
$hover_title = $this->getHeading( 'hover_title', $atts, $atts['hover_align'] );
$content = wpb_js_remove_wpautop( $content, true );
$button = '';
if ( $atts['hover_add_button'] ) {
$button = $this->renderButton( $atts );
}
$template = <<<HTML
<div class="vc-hoverbox-wrapper $css_class $shape $align $reverse $width" $id ontouchstart="">
<div class="vc-hoverbox">
<div class="vc-hoverbox-inner">
<div class="vc-hoverbox-block vc-hoverbox-front" style="background-image: url($image_src);">
<div class="vc-hoverbox-block-inner vc-hoverbox-front-inner">
$primary_title
</div>
</div>
<div class="vc-hoverbox-block vc-hoverbox-back" style="background-color: $hover_background_color;">
<div class="vc-hoverbox-block-inner vc-hoverbox-back-inner">
$hover_title
$content
$button
</div>
</div>
</div>
</div>
</div>
HTML;
return $template;

View File

@@ -0,0 +1,83 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $type
* @var $icon_fontawesome
* @var $icon_openiconic
* @var $icon_typicons
* @var $icon_entypo
* @var $icon_linecons
* @var $color
* @var $custom_color
* @var $background_style
* @var $background_color
* @var $custom_background_color
* @var $size
* @var $align
* @var $el_class
* @var $el_id
* @var $link
* @var $css_animation
* @var $css
* Shortcode class
* @var WPBakeryShortCode_Vc_Icon $this
*/
$type = $icon_fontawesome = $icon_openiconic = $icon_typicons = $icon_entypo = $icon_linecons = $color = $custom_color = $background_style = $background_color = $custom_background_color = $size = $align = $el_class = $el_id = $link = $css_animation = $css = $rel = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$class_to_filter = '';
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' ) . $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
// Enqueue needed icon font.
vc_icon_element_fonts_enqueue( $type );
$url = vc_build_link( $link );
$has_style = false;
if ( strlen( $background_style ) > 0 ) {
$has_style = true;
if ( false !== strpos( $background_style, 'outline' ) ) {
$background_style .= ' vc_icon_element-outline'; // if we use outline style it is border in css
} else {
$background_style .= ' vc_icon_element-background';
}
}
$iconClass = isset( ${'icon_' . $type} ) ? esc_attr( ${'icon_' . $type} ) : 'fa fa-adjust';
$style = '';
if ( 'custom' === $background_color ) {
if ( false !== strpos( $background_style, 'outline' ) ) {
$style = 'border-color:' . $custom_background_color;
} else {
$style = 'background-color:' . $custom_background_color;
}
}
$style = $style ? ' style="' . esc_attr( $style ) . '"' : '';
$rel = '';
if ( ! empty( $url['rel'] ) ) {
$rel = ' rel="' . esc_attr( $url['rel'] ) . '"';
}
$output = '';
$output .= '<div' . ( ! empty( $el_id ) ? ' id="' . esc_attr( $el_id ) . '"' : '' ) . ' class="vc_icon_element vc_icon_element-outer' . ( strlen( $css_class ) > 0 ? ' ' . esc_attr( trim( $css_class ) ) : '' ) . ' vc_icon_element-align-' . esc_attr( $align );
if ( $has_style ) {
$output .= ' vc_icon_element-have-style';
}
$output .= '"><div class="vc_icon_element-inner vc_icon_element-color-' . esc_attr( $color );
if ( $has_style ) {
$output .= ' vc_icon_element-have-style-inner';
}
$output .= ' vc_icon_element-size-' . esc_attr( $size ) . ' vc_icon_element-style-' . esc_attr( $background_style ) . ' vc_icon_element-background-color-' . esc_attr( $background_color ) . '" ' . $style . '><span class="vc_icon_element-icon ' . esc_attr( $iconClass ) . '" ' . ( 'custom' === $color ? 'style="color:' . esc_attr( $custom_color ) . ' !important"' : '' ) . '></span>';
if ( strlen( $link ) > 0 && strlen( $url['url'] ) > 0 ) {
$output .= '<a class="vc_icon_element-link" href="' . esc_url( $url['url'] ) . '" ' . $rel . ' title="' . esc_attr( $url['title'] ) . '" target="' . ( strlen( $url['target'] ) > 0 ? esc_attr( $url['target'] ) : '_self' ) . '"></a>';
}
$output .= '</div></div>';
return $output;

View File

@@ -0,0 +1,129 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $onclick
* @var $custom_links
* @var $custom_links_target
* @var $img_size
* @var $images
* @var $el_class
* @var $el_id
* @var $mode
* @var $slides_per_view
* @var $wrap
* @var $autoplay
* @var $hide_pagination_control
* @var $hide_prev_next_buttons
* @var $speed
* @var $partial_view
* @var $css
* @var $css_animation
* Shortcode class
* @var WPBakeryShortCode_Vc_images_carousel $this
*/
$title = $onclick = $custom_links = $custom_links_target = $img_size = $images = $el_class = $el_id = $mode = $slides_per_view = $wrap = $autoplay = $hide_pagination_control = $hide_prev_next_buttons = $speed = $partial_view = $css = $css_animation = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$gal_images = '';
$link_start = '';
$link_end = '';
$el_start = '';
$el_end = '';
$slides_wrap_start = '';
$slides_wrap_end = '';
$pretty_rand = 'link_image' === $onclick ? ' data-rel="prettyPhoto[rel-' . get_the_ID() . '-' . wp_rand() . ']"' : '';
wp_enqueue_script( 'vc_carousel_js' );
wp_enqueue_style( 'vc_carousel_css' );
if ( 'link_image' === $onclick ) {
wp_enqueue_script( 'prettyphoto' );
wp_enqueue_style( 'prettyphoto' );
}
if ( '' === $images ) {
$images = '-1,-2,-3';
}
if ( 'custom_link' === $onclick ) {
$custom_links = vc_value_from_safe( $custom_links );
$custom_links = explode( ',', $custom_links );
}
$images = explode( ',', $images );
$i = - 1;
$class_to_filter = 'wpb_images_carousel wpb_content_element vc_clearfix';
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' ) . $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
$carousel_id = 'vc_images-carousel-' . WPBakeryShortCode_Vc_Images_Carousel::getCarouselIndex();
$slider_width = $this->getSliderWidth( $img_size );
$output = '';
$output .= '<div' . ( ! empty( $el_id ) ? ' id="' . esc_attr( $el_id ) . '"' : '' ) . ' class="' . esc_attr( apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $css_class, $this->settings['base'], $atts ) ) . '">';
$output .= '<div class="wpb_wrapper">';
$output .= wpb_widget_title( array(
'title' => $title,
'extraclass' => 'wpb_gallery_heading',
) );
$output .= '<div id="' . esc_attr( $carousel_id ) . '" data-ride="vc_carousel" data-wrap="' . ( 'yes' === $wrap ? 'true' : 'false' ) . '" style="width: ' . esc_attr( $slider_width ) . ';" data-interval="' . ( 'yes' === $autoplay ? esc_attr( $speed ) : 0 ) . '" data-auto-height="yes" data-mode="' . esc_attr( $mode ) . '" data-partial="' . ( 'yes' === $partial_view ? 'true' : 'false' ) . '" data-per-view="' . esc_attr( $slides_per_view ) . '" data-hide-on-end="' . ( 'yes' === $autoplay ? 'false' : 'true' ) . '" class="vc_slide vc_images_carousel">';
if ( 'yes' !== $hide_pagination_control ) {
$output .= '<ol class="vc_carousel-indicators">';
$count = count( $images );
for ( $z = 0; $z < $count; $z ++ ) {
$output .= '<li data-target="#' . esc_attr( $carousel_id ) . '" data-slide-to="' . esc_attr( $z ) . '"></li>';
}
$output .= '</ol>';
}
$output .= '<div class="vc_carousel-inner"><div class="vc_carousel-slideline"><div class="vc_carousel-slideline-inner">';
foreach ( $images as $attach_id ) {
$i ++;
if ( $attach_id > 0 ) {
$post_thumbnail = wpb_getImageBySize( array(
'attach_id' => $attach_id,
'thumb_size' => $img_size,
) );
} else {
$post_thumbnail = array();
$post_thumbnail['thumbnail'] = '<img src="' . esc_url( vc_asset_url( 'vc/no_image.png' ) ) . '" />';
$post_thumbnail['p_img_large'][0] = vc_asset_url( 'vc/no_image.png' );
}
$thumbnail = $post_thumbnail['thumbnail'];
$output .= '<div class="vc_item"><div class="vc_inner">';
if ( 'link_image' === $onclick ) {
$p_img_large = $post_thumbnail['p_img_large'];
$output .= '<a class="prettyphoto" href="' . esc_url( $p_img_large[0] ) . '"';
$output .= $pretty_rand;
$output .= '>';
$output .= $thumbnail;
$output .= '</a>';
} elseif ( 'custom_link' === $onclick && isset( $custom_links[ $i ] ) && '' !== $custom_links[ $i ] ) {
$output .= '<a href="' . esc_url( $custom_links[ $i ] ) . '"' . ( ! empty( $custom_links_target ) ? ' target="' . esc_attr( $custom_links_target ) . '"' : '' ) . '>';
$output .= $thumbnail;
$output .= '</a>';
} else {
$output .= $thumbnail;
}
$output .= '</div></div>';
}
$output .= '</div></div></div>';
if ( 'yes' !== $hide_prev_next_buttons ) {
$output .= '<a class="vc_left vc_carousel-control" href="#' . esc_attr( $carousel_id ) . '" data-slide="prev"><span class="icon-prev"></span></a>';
$output .= '<a class="vc_right vc_carousel-control" href="#' . esc_attr( $carousel_id ) . '" data-slide="next"><span class="icon-next"></span></a>';
}
$output .= '</div></div></div>';
return $output;

View File

@@ -0,0 +1,21 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $el_class
* Shortcode class
* @var WPBakeryShortCode $this
*/
$el_class = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$css = $this->getExtraClass( $el_class );
$output = '<div class="vc_items' . esc_attr( $css ) . '">' . esc_html__( 'Item', 'js_composer' ) . '</div>';
return $output;

View File

@@ -0,0 +1,31 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $el_class
* @var $content - shortcode content
* Shortcode class
* @var WPBakeryShortCodesContainer $this
*/
$el_class = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$el_class = $this->getExtraClass( $el_class );
$el_class .= ( ! empty( $el_class ) ? ' ' : '' ) . 'wpb_item items_container';
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $el_class, $this->settings['base'], $atts );
$output = '
<div class="' . esc_attr( $css_class ) . '">
<div class="wpb_wrapper">
' . wpb_js_remove_wpautop( $content ) . '
</div>
</div>
';
return $output;

View File

@@ -0,0 +1,196 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $title
* @var $el_class
* @var $el_id
* @var $type
* @var $style
* @var $legend
* @var $animation
* @var $tooltips
* @var $x_values
* @var $values
* @var $css
* @var $css_animation
* Shortcode class
* @var WPBakeryShortCode_Vc_Line_Chart $this
*/
$el_class = $el_id = $title = $type = $legend = $style = $tooltips = $animation = $x_values = $values = $css = $css_animation = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$base_colors = array(
'normal' => array(
'blue' => '#5472d2',
'turquoise' => '#00c1cf',
'pink' => '#fe6c61',
'violet' => '#8d6dc4',
'peacoc' => '#4cadc9',
'chino' => '#cec2ab',
'mulled-wine' => '#50485b',
'vista-blue' => '#75d69c',
'orange' => '#f7be68',
'sky' => '#5aa1e3',
'green' => '#6dab3c',
'juicy-pink' => '#f4524d',
'sandy-brown' => '#f79468',
'purple' => '#b97ebb',
'black' => '#2a2a2a',
'grey' => '#ebebeb',
'white' => '#ffffff',
'default' => '#f7f7f7',
'primary' => '#0088cc',
'info' => '#58b9da',
'success' => '#6ab165',
'warning' => '#ff9900',
'danger' => '#ff675b',
'inverse' => '#555555',
),
'active' => array(
'blue' => '#3c5ecc',
'turquoise' => '#00a4b0',
'pink' => '#fe5043',
'violet' => '#7c57bb',
'peacoc' => '#39a0bd',
'chino' => '#c3b498',
'mulled-wine' => '#413a4a',
'vista-blue' => '#5dcf8b',
'orange' => '#f5b14b',
'sky' => '#4092df',
'green' => '#5f9434',
'juicy-pink' => '#f23630',
'sandy-brown' => '#f57f4b',
'purple' => '#ae6ab0',
'black' => '#1b1b1b',
'grey' => '#dcdcdc',
'white' => '#f0f0f0',
'default' => '#e8e8e8',
'primary' => '#0074ad',
'info' => '#3fafd4',
'success' => '#59a453',
'warning' => '#e08700',
'danger' => '#ff4b3c',
'inverse' => '#464646',
),
);
$colors = array(
'flat' => array(
'normal' => $base_colors['normal'],
'active' => $base_colors['active'],
),
);
foreach ( $base_colors['normal'] as $name => $color ) {
$colors['modern']['normal'][ $name ] = array( vc_colorCreator( $color, 7 ), $color );
}
foreach ( $base_colors['active'] as $name => $color ) {
$colors['modern']['active'][ $name ] = array( vc_colorCreator( $color, 7 ), $color );
}
wp_enqueue_script( 'vc_line_chart' );
$class_to_filter = 'vc_chart vc_line-chart wpb_content_element';
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' ) . $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
$options = array();
if ( ! empty( $legend ) ) {
$options[] = 'data-vc-legend="1"';
}
if ( ! empty( $tooltips ) ) {
$options[] = 'data-vc-tooltips="1"';
}
if ( ! empty( $animation ) ) {
$options[] = 'data-vc-animation="' . esc_attr( str_replace( 'easein', 'easeIn', $animation ) ) . '"';
}
$values = (array) vc_param_group_parse_atts( $values );
$data = array(
'labels' => explode( ';', trim( $x_values, ';' ) ),
'datasets' => array(),
);
foreach ( $values as $k => $v ) {
if ( 'custom' === $style ) {
if ( ! empty( $v['custom_color'] ) ) {
$color = $v['custom_color'];
$highlight = vc_colorCreator( $v['custom_color'], - 10 ); // 10% darker
} else {
$color = 'grey';
$highlight = 'grey';
}
} else {
$color = isset( $colors[ $style ]['normal'][ $v['color'] ] ) ? $colors[ $style ]['normal'][ $v['color'] ] : $v['normal']['color'];
$highlight = isset( $colors[ $style ]['active'][ $v['color'] ] ) ? $colors[ $style ]['active'][ $v['color'] ] : $v['active']['color'];
}
// don't use gradients for lines
if ( 'line' === $type ) {
$color = is_array( $color ) ? end( $color ) : $color;
$highlight = is_array( $highlight ) ? end( $highlight ) : $highlight;
$rgb = vc_hex2rgb( $color );
$fill_color = 'rgba(' . $rgb[0] . ', ' . $rgb[1] . ', ' . $rgb[2] . ', 0.1)';
} else {
$fill_color = $color;
}
if ( 'modern' === $style ) {
$stroke_color = vc_colorCreator( is_array( $color ) ? end( $color ) : $color, - 7 );
$highlight_stroke_color = vc_colorCreator( $stroke_color, - 7 );
} else {
$stroke_color = $color;
$highlight_stroke_color = $highlight;
}
$data['datasets'][] = array(
'label' => isset( $v['title'] ) ? $v['title'] : '',
'fillColor' => $fill_color,
'strokeColor' => $stroke_color,
'pointColor' => $color,
'pointStrokeColor' => $color,
'highlightFill' => $highlight,
'highlightStroke' => $highlight_stroke_color,
'pointHighlightFill' => $highlight_stroke_color,
'pointHighlightStroke' => $highlight_stroke_color,
'data' => explode( ';', isset( $v['y_values'] ) ? trim( $v['y_values'], ';' ) : '' ),
);
}
$options[] = 'data-vc-type="' . esc_attr( $type ) . '"';
$options[] = 'data-vc-values="' . htmlentities( wp_json_encode( $data ) ) . '"';
if ( '' !== $title ) {
$title = '<h2 class="wpb_heading">' . $title . '</h4>';
}
$canvas_html = '<canvas class="vc_line-chart-canvas" width="1" height="1"></canvas>';
$legend_html = '';
if ( $legend ) {
foreach ( $data['datasets'] as $v ) {
$color = is_array( $v['pointColor'] ) ? current( $v['pointColor'] ) : $v['pointColor'];
$legend_html .= '<li><span style="background-color:' . $color . '"></span>' . $v['label'] . '</li>';
}
$legend_html = '<ul class="vc_chart-legend">' . $legend_html . '</ul>';
$canvas_html = '<div class="vc_chart-with-legend">' . $canvas_html . '</div>';
}
if ( ! empty( $el_id ) ) {
$options[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '
<div class="' . esc_attr( $css_class ) . '" ' . implode( ' ', $options ) . '>
' . $title . '
<div class="wpb_wrapper">
' . $canvas_html . $legend_html . '
</div>' . '
</div>' . '
';
return $output;

View File

@@ -0,0 +1,102 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
*
* @todo add $icon_... defaults
* @todo add $icon_typicons and etc
*
* @var $atts
* @var $el_class
* @var $el_id
* @var $message_box_style
* @var $style
* @var $color
* @var $message_box_color
* @var $css_animation
* @var $icon_type
* @var $icon_fontawesome
* @var $content - shortcode content
* @var $css
* Shortcode class
* @var WPBakeryShortCode_Vc_Message $this
*/
$el_class = $el_id = $message_box_color = $message_box_style = $style = $css = $color = $css_animation = $icon_type = '';
$icon_fontawesome = $icon_linecons = $icon_openiconic = $icon_typicons = $icon_entypo = '';
$defaultIconClass = 'fa fa-adjust';
$atts = $this->convertAttributesToMessageBox2( $atts );
$atts = vc_map_get_attributes( $this->getShortcode(), $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 && false === strpos( 'alert', $color ) ) ? ( 'vc_color-' . $color ) : ( 'vc_color-' . $message_box_color ) ),
'css_animation' => $this->getCSSAnimation( $css_animation ),
);
$class_to_filter = preg_replace( array(
'/\s+/',
'/^\s|\s$/',
), array(
' ',
'',
), implode( ' ', $elementClass ) );
$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 );
// Pick up icons
$iconClass = isset( ${'icon_' . $icon_type} ) ? ${'icon_' . $icon_type} : $defaultIconClass;
switch ( $color ) {
case 'info':
$icon_type = 'fontawesome';
$iconClass = 'fas 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 = 'fas fa-check';
break;
case 'alert-success':
$icon_type = 'pixelicons';
$iconClass = 'vc_pixel_icon vc_pixel_icon-tick';
break;
case 'warning':
$icon_type = 'fontawesome';
$iconClass = 'fas fa-exclamation-triangle';
break;
case 'alert-warning':
$icon_type = 'pixelicons';
$iconClass = 'vc_pixel_icon vc_pixel_icon-alert';
break;
case 'danger':
$icon_type = 'fontawesome';
$iconClass = 'fas fa-times';
break;
case 'alert-danger':
$icon_type = 'pixelicons';
$iconClass = 'vc_pixel_icon vc_pixel_icon-explanation';
break;
case 'alert-custom':
default:
break;
}
// Enqueue needed font for icon element
if ( 'pixelicons' !== $icon_type ) {
vc_icon_element_fonts_enqueue( $icon_type );
}
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '';
$output .= '<div class="' . esc_attr( $css_class ) . '" ' . implode( ' ', $wrapper_attributes ) . '>' . '<div class="vc_message_box-icon"><i class="' . esc_attr( $iconClass ) . '"></i></div>' . wpb_js_remove_wpautop( $content, true ) . '</div>';
return $output;

View File

@@ -0,0 +1,82 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $el_class
* @var $el_id
* @var $value
* @var $units
* @var $color
* @var $custom_color
* @var $label_value
* @var $css
* @var $css_animation
* Shortcode class
* @var WPBakeryShortCode_Vc_Pie $this
*/
$title = $el_class = $el_id = $value = $units = $color = $custom_color = $label_value = $css = $css_animation = '';
$atts = $this->convertOldColorsToNew( $atts );
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
wp_enqueue_script( 'vc_pie' );
$colors = array(
'blue' => '#5472d2',
'turquoise' => '#00c1cf',
'pink' => '#fe6c61',
'violet' => '#8d6dc4',
'peacoc' => '#4cadc9',
'chino' => '#cec2ab',
'mulled-wine' => '#50485b',
'vista-blue' => '#75d69c',
'orange' => '#f7be68',
'sky' => '#5aa1e3',
'green' => '#6dab3c',
'juicy-pink' => '#f4524d',
'sandy-brown' => '#f79468',
'purple' => '#b97ebb',
'black' => '#2a2a2a',
'grey' => '#ebebeb',
'white' => '#ffffff',
);
if ( 'custom' === $color ) {
$color = $custom_color;
} else {
$color = isset( $colors[ $color ] ) ? $colors[ $color ] : '';
}
if ( ! $color ) {
$color = $colors['grey'];
}
$class_to_filter = 'vc_pie_chart wpb_content_element';
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' ) . $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '<div ' . implode( ' ', $wrapper_attributes ) . ' class= "' . esc_attr( $css_class ) . '" data-pie-value="' . esc_attr( $value ) . '" data-pie-label-value="' . esc_attr( $label_value ) . '" data-pie-units="' . esc_attr( $units ) . '" data-pie-color="' . esc_attr( $color ) . '">';
$output .= '<div class="wpb_wrapper">';
$output .= '<div class="vc_pie_wrapper">';
$output .= '<span class="vc_pie_chart_back" style="border-color: ' . esc_attr( $color ) . '"></span>';
$output .= '<span class="vc_pie_chart_value"></span>';
$output .= '<canvas width="101" height="101"></canvas>';
$output .= '</div>';
if ( '' !== $title ) {
$output .= '<h4 class="wpb_heading wpb_pie_chart_heading">' . $title . '</h4>';
}
$output .= '</div>';
$output .= '</div>';
return $output;

View File

@@ -0,0 +1,45 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $type
* @var $annotation // TODO: check why annotation doesn't set before
* @var $css
* @var $css_animation
* @var $el_class
* @var $el_id
* Shortcode class
* @var WPBakeryShortCode_Vc_Pinterest $this
*/
$type = $annotation = $css = $el_class = $el_id = $css_animation = '';
global $post;
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$url = rawurlencode( get_permalink() );
if ( has_post_thumbnail() ) {
$img_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' );
$media = ( is_array( $img_url ) ) ? '&amp;media=' . rawurlencode( $img_url[0] ) : '';
} else {
$media = '';
}
$excerpt = is_object( $post ) && isset( $post->post_excerpt ) ? $post->post_excerpt : '';
$description = ( '' !== $excerpt ) ? '&amp;description=' . rawurlencode( wp_strip_all_tags( $excerpt ) ) : '';
$el_class = isset( $el_class ) ? $el_class : '';
$class_to_filter = 'wpb_pinterest wpb_content_element wpb_pinterest_type_' . $type;
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' ) . $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output .= '<div class="' . esc_attr( $css_class ) . '" ' . implode( ' ', $wrapper_attributes ) . '>';
$output .= '<a href="https://pinterest.com/pin/create/button/?url=' . $url . $media . $description . '" class="pin-it-button" count-layout="' . $type . '"><img border="0" src="https://assets.pinterest.com/images/PinExt.png" title="Pin It" /></a>';
$output .= '</div>';
return $output;

View File

@@ -0,0 +1,234 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $type
* @var $count
* @var $interval
* @var $slides_content
* @var $slides_title
* @var $link
* @var $custom_links
* @var $thumb_size
* @var $posttypes
* @var $posts_in
* @var $categories
* @var $orderby
* @var $order
* @var $el_class
* @var $el_id
* @var $css
* Shortcode class
* @var WPBakeryShortCode_Vc_Posts_slider $this
*/
$title = $type = $count = $interval = $slides_content = $slides_title = $link = $custom_links = $thumb_size = $posttypes = $posts_in = $categories = $order = $orderby = $el_class = $el_id = $css = '';
$link_image_start = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$gal_images = '';
$link_start = '';
$link_end = '';
$el_start = '';
$el_end = '';
$slides_wrap_start = '';
$slides_wrap_end = '';
if ( 'nivo' === $type ) {
$type = ' wpb_slider_nivo theme-default';
wp_enqueue_script( 'nivo-slider' );
wp_enqueue_style( 'nivo-slider-css' );
wp_enqueue_style( 'nivo-slider-theme' );
$slides_wrap_start = '<div class="nivoSlider">';
$slides_wrap_end = '</div>';
} elseif ( 'flexslider' === $type || 'flexslider_fade' === $type || 'flexslider_slide' === $type || 'fading' === $type ) {
$el_start = '<li>';
$el_end = '</li>';
$slides_wrap_start = '<ul class="slides">';
$slides_wrap_end = '</ul>';
wp_enqueue_style( 'flexslider' );
wp_enqueue_script( 'flexslider' );
}
$flex_fx = '';
if ( 'flexslider' === $type || 'flexslider_fade' === $type || 'fading' === $type ) {
$type = ' wpb_flexslider flexslider_fade flexslider';
$flex_fx = ' data-flex_fx="fade"';
} elseif ( 'flexslider_slide' === $type ) {
$type = ' wpb_flexslider flexslider_slide flexslider';
$flex_fx = ' data-flex_fx="slide"';
}
if ( 'link_image' === $link ) {
wp_enqueue_script( 'prettyphoto' );
wp_enqueue_style( 'prettyphoto' );
}
$query_args = array(
'post_status' => 'publish',
);
// exclude current post/page from query
if ( '' !== $posts_in ) {
$query_args['post__in'] = explode( ',', $posts_in );
}
global $vc_posts_grid_exclude_id;
$vc_posts_grid_exclude_id[] = get_the_ID();
$query_args['post__not_in'] = array( get_the_ID() );
// Post teasers count
if ( '' !== $count && ! is_numeric( $count ) ) {
$count = - 1;
}
if ( '' !== $count && is_numeric( $count ) ) {
$query_args['posts_per_page'] = $count;
}
// Post types
$pt = array();
if ( '' !== $posttypes ) {
$posttypes = explode( ',', $posttypes );
foreach ( $posttypes as $post_type ) {
array_push( $pt, $post_type );
}
$query_args['post_type'] = $pt;
}
// Narrow by categories
if ( '' !== $categories ) {
$categories = explode( ',', $categories );
$gc = array();
foreach ( $categories as $grid_cat ) {
array_push( $gc, $grid_cat );
}
$gc = implode( ',', $gc );
// http://snipplr.com/view/17434/wordpress-get-category-slug/
$query_args['category_name'] = $gc;
$taxonomies = get_taxonomies( '', 'object' );
$query_args['tax_query'] = array( 'relation' => 'OR' );
foreach ( $taxonomies as $t ) {
if ( in_array( $t->object_type[0], $pt, true ) ) {
$query_args['tax_query'][] = array(
'taxonomy' => $t->name,
'terms' => $categories,
'field' => 'slug',
);
}
}
}
// Order posts
if ( null !== $orderby ) {
$query_args['orderby'] = $orderby;
}
$query_args['order'] = $order;
// Run query
$my_query = new WP_Query( $query_args );
$pretty_rel_random = ' data-rel="prettyPhoto[rel-' . get_the_ID() . '-' . wp_rand() . ']"';
if ( 'custom_link' === $link ) {
$custom_links = explode( ',', vc_value_from_safe( $custom_links ) );
}
$teasers = '';
$i = - 1;
while ( $my_query->have_posts() ) {
$i ++;
$my_query->the_post();
$post_title = the_title( '', '', false );
$post_id = $my_query->post->ID;
if ( in_array( get_the_ID(), $vc_posts_grid_exclude_id, true ) ) {
continue;
}
if ( 'teaser' === $slides_content ) {
$content = apply_filters( 'the_excerpt', get_the_excerpt() );
} else {
$content = '';
}
$thumbnail = '';
// Thumbnail logic
$post_thumbnail = $p_img_large = '';
$post_thumbnail = wpb_getImageBySize( array(
'post_id' => $post_id,
'thumb_size' => $thumb_size,
) );
$thumbnail = $post_thumbnail['thumbnail'];
$p_img_large = $post_thumbnail['p_img_large'];
// Link logic
if ( 'link_no' !== $link ) {
if ( 'link_post' === $link ) {
$link_image_start = '<a class="link_image" href="' . esc_url( get_permalink( $post_id ) ) . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'js_composer' ), the_title_attribute( 'echo=0' ) ) . '">';
} elseif ( 'link_image' === $link ) {
$p_video = get_post_meta( $post_id, '_p_video', true );
if ( '' !== $p_video ) {
$p_link = $p_video;
} else {
$p_link = $p_img_large[0];
}
$link_image_start = '<a class="link_image prettyphoto" href="' . esc_url( $p_link ) . '" ' . $pretty_rel_random . ' title="' . the_title_attribute( 'echo=0' ) . '" >';
} elseif ( 'custom_link' === $link ) {
if ( isset( $custom_links[ $i ] ) ) {
$slide_custom_link = $custom_links[ $i ];
} else {
$slide_custom_link = $custom_links[0];
}
$link_image_start = '<a class="link_image" href="' . esc_url( $slide_custom_link ) . '">';
}
$link_image_end = '</a>';
} else {
$link_image_start = '';
$link_image_end = '';
}
$description = '';
if ( '' !== $slides_content && '' !== $content && ( ' wpb_flexslider flexslider_fade flexslider' === $type || ' wpb_flexslider flexslider_slide flexslider' === $type ) ) {
$description = '<div class="flex-caption">';
if ( $slides_title ) {
$description .= '<h2 class="post-title">' . $link_image_start . $post_title . $link_image_end . '</h2>';
}
$description .= $content;
$description .= '</div>';
}
$teasers .= $el_start . $link_image_start . $thumbnail . $link_image_end . $description . $el_end;
}//end while
wp_reset_postdata();
if ( $teasers ) {
$teasers = $slides_wrap_start . $teasers . $slides_wrap_end;
} else {
$teasers = esc_html__( 'Nothing found.', 'js_composer' );
}
$class_to_filter = 'wpb_gallery wpb_posts_slider wpb_content_element';
$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 );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '
<div class="' . esc_attr( $css_class ) . '" ' . implode( ' ', $wrapper_attributes ) . '>
<div class="wpb_wrapper">
' . wpb_widget_title( array(
'title' => $title,
'extraclass' => 'wpb_posts_slider_heading',
) ) . '
<div class="wpb_gallery_slides' . $type . '" data-interval="' . $interval . '"' . $flex_fx . '>' . $teasers . '</div>
</div>
</div>
';
return $output;

View File

@@ -0,0 +1,108 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $values
* @var $units
* @var $bgcolor
* @var $custombgcolor
* @var $customtxtcolor
* @var $options
* @var $el_class
* @var $el_id
* @var $css
* @var $css_animation
* Shortcode class
* @var WPBakeryShortCode_Vc_Progress_Bar $this
*/
$title = $values = $units = $bgcolor = $css = $custombgcolor = $customtxtcolor = $options = $el_class = $el_id = $css_animation = '';
$output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
$atts = $this->convertAttributesToNewProgressBar( $atts );
extract( $atts );
wp_enqueue_script( 'vc_waypoints' );
$el_class = $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation );
$bar_options = array();
$options = explode( ',', $options );
if ( in_array( 'animated', $options, true ) ) {
$bar_options[] = 'animated';
}
if ( in_array( 'striped', $options, true ) ) {
$bar_options[] = 'striped';
}
if ( 'custom' === $bgcolor && '' !== $custombgcolor ) {
$custombgcolor = ' style="' . vc_get_css_color( 'background-color', $custombgcolor ) . '"';
if ( '' !== $customtxtcolor ) {
$customtxtcolor = ' style="' . vc_get_css_color( 'color', $customtxtcolor ) . '"';
}
$bgcolor = '';
} else {
$custombgcolor = '';
$customtxtcolor = '';
$bgcolor = 'vc_progress-bar-color-' . esc_attr( $bgcolor );
$el_class .= ' ' . $bgcolor;
}
$class_to_filter = 'vc_progress_bar wpb_content_element';
$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 );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '<div class="' . esc_attr( $css_class ) . '" ' . implode( ' ', $wrapper_attributes ) . '>';
$output .= wpb_widget_title( array(
'title' => $title,
'extraclass' => 'wpb_progress_bar_heading',
) );
$values = (array) vc_param_group_parse_atts( $values );
$max_value = 0.0;
$graph_lines_data = array();
foreach ( $values as $data ) {
$new_line = $data;
$new_line['value'] = isset( $data['value'] ) ? $data['value'] : 0;
$new_line['label'] = isset( $data['label'] ) ? $data['label'] : '';
$new_line['bgcolor'] = isset( $data['color'] ) && 'custom' !== $data['color'] ? '' : $custombgcolor;
$new_line['txtcolor'] = isset( $data['color'] ) && 'custom' !== $data['color'] ? '' : $customtxtcolor;
if ( isset( $data['customcolor'] ) && ( ! isset( $data['color'] ) || 'custom' === $data['color'] ) ) {
$new_line['bgcolor'] = ' style="background-color: ' . esc_attr( $data['customcolor'] ) . ';"';
}
if ( isset( $data['customtxtcolor'] ) && ( ! isset( $data['color'] ) || 'custom' === $data['color'] ) ) {
$new_line['txtcolor'] = ' style="color: ' . esc_attr( $data['customtxtcolor'] ) . ';"';
}
if ( $max_value < (float) $new_line['value'] ) {
$max_value = $new_line['value'];
}
$graph_lines_data[] = $new_line;
}
foreach ( $graph_lines_data as $line ) {
$unit = ( '' !== $units ) ? ' <span class="vc_label_units">' . $line['value'] . $units . '</span>' : '';
$output .= '<div class="vc_general vc_single_bar' . ( ( isset( $line['color'] ) && 'custom' !== $line['color'] ) ?
' vc_progress-bar-color-' . $line['color'] : '' )
. '">';
$output .= '<small class="vc_label"' . $line['txtcolor'] . '>' . $line['label'] . $unit . '</small>';
if ( $max_value > 100.00 ) {
$percentage_value = (float) $line['value'] > 0 && $max_value > 100.00 ? round( (float) $line['value'] / $max_value * 100, 4 ) : 0;
} else {
$percentage_value = $line['value'];
}
$output .= '<span class="vc_bar ' . esc_attr( implode( ' ', $bar_options ) ) . '" data-percentage-value="' . esc_attr( $percentage_value ) . '" data-value="' . esc_attr( $line['value'] ) . '"' . $line['bgcolor'] . '></span>';
$output .= '</div>';
}
$output .= '</div>';
return $output;

View File

@@ -0,0 +1,43 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $el_class
* @var $el_id
* @var $content - shortcode content
* @var $css
* Shortcode class
* @var WPBakeryShortCode_Vc_Raw_html $this
*/
$el_class = $el_id = $css = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$content = rawurldecode( base64_decode( wp_strip_all_tags( $content ) ) );
$content = wpb_js_remove_wpautop( apply_filters( 'vc_raw_html_module_content', $content ) );
// template is also used by 'Raw JS' shortcode which doesn't have Design Options
if ( ! isset( $css ) ) {
$css = '';
}
$class_to_filter = 'wpb_raw_code ' . ( ( 'vc_raw_html' === $this->settings['base'] ) ? 'wpb_content_element wpb_raw_html' : 'wpb_raw_js' );
$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 );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '
<div class="' . esc_attr( $css_class ) . '" ' . implode( ' ', $wrapper_attributes ) . '>
<div class="wpb_wrapper">
' . $content . '
</div>
</div>
';
return $output;

View File

@@ -0,0 +1,189 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $title
* @var $el_class
* @var $el_id
* @var $type
* @var $style
* @var $legend
* @var $animation
* @var $tooltips
* @var $stroke_color
* @var $custom_stroke_color
* @var $stroke_width
* @var $values
* @var $css
* @var $css_animation
* Shortcode class
* @var WPBakeryShortCode_Vc_Round_Chart $this
*/
$el_class = $el_id = $title = $type = $style = $legend = $animation = $tooltips = $stroke_color = $stroke_width = $values = $css = $css_animation = $custom_stroke_color = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$base_colors = array(
'normal' => array(
'blue' => '#5472d2',
'turquoise' => '#00c1cf',
'pink' => '#fe6c61',
'violet' => '#8d6dc4',
'peacoc' => '#4cadc9',
'chino' => '#cec2ab',
'mulled-wine' => '#50485b',
'vista-blue' => '#75d69c',
'orange' => '#f7be68',
'sky' => '#5aa1e3',
'green' => '#6dab3c',
'juicy-pink' => '#f4524d',
'sandy-brown' => '#f79468',
'purple' => '#b97ebb',
'black' => '#2a2a2a',
'grey' => '#ebebeb',
'white' => '#ffffff',
'default' => '#f7f7f7',
'primary' => '#0088cc',
'info' => '#58b9da',
'success' => '#6ab165',
'warning' => '#ff9900',
'danger' => '#ff675b',
'inverse' => '#555555',
),
'active' => array(
'blue' => '#3c5ecc',
'turquoise' => '#00a4b0',
'pink' => '#fe5043',
'violet' => '#7c57bb',
'peacoc' => '#39a0bd',
'chino' => '#c3b498',
'mulled-wine' => '#413a4a',
'vista-blue' => '#5dcf8b',
'orange' => '#f5b14b',
'sky' => '#4092df',
'green' => '#5f9434',
'juicy-pink' => '#f23630',
'sandy-brown' => '#f57f4b',
'purple' => '#ae6ab0',
'black' => '#1b1b1b',
'grey' => '#dcdcdc',
'white' => '#f0f0f0',
'default' => '#e8e8e8',
'primary' => '#0074ad',
'info' => '#3fafd4',
'success' => '#59a453',
'warning' => '#e08700',
'danger' => '#ff4b3c',
'inverse' => '#464646',
),
);
$colors = array(
'flat' => array(
'normal' => $base_colors['normal'],
'active' => $base_colors['active'],
),
);
foreach ( $base_colors['normal'] as $name => $color ) {
$colors['modern']['normal'][ $name ] = array( vc_colorCreator( $color, 7 ), $color );
}
foreach ( $base_colors['active'] as $name => $color ) {
$colors['modern']['active'][ $name ] = array( vc_colorCreator( $color, 7 ), $color );
}
wp_enqueue_script( 'vc_round_chart' );
$class_to_filter = 'vc_chart vc_round-chart wpb_content_element';
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' ) . $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
$options = array();
if ( ! empty( $legend ) ) {
$options[] = 'data-vc-legend="1"';
}
if ( ! empty( $tooltips ) ) {
$options[] = 'data-vc-tooltips="1"';
}
if ( ! empty( $animation ) ) {
$options[] = 'data-vc-animation="' . esc_attr( str_replace( 'easein', 'easeIn', $animation ) ) . '"';
}
if ( ! empty( $stroke_color ) ) {
if ( 'custom' === $stroke_color ) {
if ( $custom_stroke_color ) {
$color = $custom_stroke_color;
} else {
$color = $base_colors['normal']['white'];
}
} else {
$color = $base_colors['normal'][ $stroke_color ];
}
$options[] = 'data-vc-stroke-color="' . esc_attr( $color ) . '"';
}
if ( ! empty( $stroke_width ) ) {
$options[] = 'data-vc-stroke-width="' . esc_attr( $stroke_width ) . '"';
}
$values = (array) vc_param_group_parse_atts( $values );
$data = array();
foreach ( $values as $k => $v ) {
if ( 'custom' === $style ) {
if ( ! empty( $v['custom_color'] ) ) {
$color = $v['custom_color'];
$highlight = vc_colorCreator( $v['custom_color'], - 10 ); // 10% darker
} else {
$color = $base_colors['normal']['grey'];
$highlight = $base_colors['active']['grey'];
}
} else {
$color = isset( $colors[ $style ]['normal'][ $v['color'] ] ) ? $colors[ $style ]['normal'][ $v['color'] ] : $v['normal']['color'];
$highlight = isset( $colors[ $style ]['active'][ $v['color'] ] ) ? $colors[ $style ]['active'][ $v['color'] ] : $v['active']['color'];
}
$data[] = array(
'value' => intval( isset( $v['value'] ) ? $v['value'] : 0 ),
'color' => $color,
'highlight' => $highlight,
'label' => isset( $v['title'] ) ? $v['title'] : '',
);
}
$options[] = 'data-vc-type="' . esc_attr( $type ) . '"';
$options[] = 'data-vc-values="' . esc_attr( wp_json_encode( $data ) ) . '"';
if ( '' !== $title ) {
$title = '<h2 class="wpb_heading">' . $title . '</h4>';
}
$canvas_html = '<canvas class="vc_round-chart-canvas" width="1" height="1"></canvas>';
$legend_html = '';
if ( $legend ) {
foreach ( $data as $v ) {
$color = is_array( $v['color'] ) ? current( $v['color'] ) : $v['color'];
$legend_html .= '<li><span style="background-color:' . $color . '"></span>' . $v['label'] . '</li>';
}
$legend_html = '<ul class="vc_chart-legend">' . $legend_html . '</ul>';
$canvas_html = '<div class="vc_chart-with-legend">' . $canvas_html . '</div>';
}
if ( ! empty( $el_id ) ) {
$options[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '
<div class="' . esc_attr( $css_class ) . '" ' . implode( ' ', $options ) . '>
' . $title . '
<div class="wpb_wrapper">
' . $canvas_html . $legend_html . '
</div>' . '
</div>' . '
';
return $output;

View File

@@ -0,0 +1,160 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $el_class
* @var $full_width
* @var $full_height
* @var $equal_height
* @var $columns_placement
* @var $content_placement
* @var $parallax
* @var $parallax_image
* @var $css
* @var $el_id
* @var $video_bg
* @var $video_bg_url
* @var $video_bg_parallax
* @var $parallax_speed_bg
* @var $parallax_speed_video
* @var $content - shortcode content
* @var $css_animation
* Shortcode class
* @var WPBakeryShortCode_Vc_Row $this
*/
$el_class = $full_height = $parallax_speed_bg = $parallax_speed_video = $full_width = $equal_height = $flex_row = $columns_placement = $content_placement = $parallax = $parallax_image = $css = $el_id = $video_bg = $video_bg_url = $video_bg_parallax = $css_animation = '';
$disable_element = '';
$output = $after_output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
wp_enqueue_script( 'wpb_composer_front_js' );
$el_class = $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation );
$css_classes = array(
'vc_row',
'wpb_row',
// deprecated
'vc_row-fluid',
$el_class,
vc_shortcode_custom_css_class( $css ),
);
if ( 'yes' === $disable_element ) {
if ( vc_is_page_editable() ) {
$css_classes[] = 'vc_hidden-lg vc_hidden-xs vc_hidden-sm vc_hidden-md';
} else {
return '';
}
}
if ( vc_shortcode_custom_css_has_property( $css, array(
'border',
'background',
) ) || $video_bg || $parallax
) {
$css_classes[] = 'vc_row-has-fill';
}
if ( ! empty( $atts['gap'] ) ) {
$css_classes[] = 'vc_column-gap-' . $atts['gap'];
}
if ( ! empty( $atts['rtl_reverse'] ) ) {
$css_classes[] = 'vc_rtl-columns-reverse';
}
$wrapper_attributes = array();
// build attributes for wrapper
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
if ( ! empty( $full_width ) ) {
$wrapper_attributes[] = 'data-vc-full-width="true"';
$wrapper_attributes[] = 'data-vc-full-width-init="false"';
if ( 'stretch_row_content' === $full_width ) {
$wrapper_attributes[] = 'data-vc-stretch-content="true"';
} elseif ( 'stretch_row_content_no_spaces' === $full_width ) {
$wrapper_attributes[] = 'data-vc-stretch-content="true"';
$css_classes[] = 'vc_row-no-padding';
}
$after_output .= '<div class="vc_row-full-width vc_clearfix"></div>';
}
if ( ! empty( $full_height ) ) {
$css_classes[] = 'vc_row-o-full-height';
if ( ! empty( $columns_placement ) ) {
$flex_row = true;
$css_classes[] = 'vc_row-o-columns-' . $columns_placement;
if ( 'stretch' === $columns_placement ) {
$css_classes[] = 'vc_row-o-equal-height';
}
}
}
if ( ! empty( $equal_height ) ) {
$flex_row = true;
$css_classes[] = 'vc_row-o-equal-height';
}
if ( ! empty( $content_placement ) ) {
$flex_row = true;
$css_classes[] = 'vc_row-o-content-' . $content_placement;
}
if ( ! empty( $flex_row ) ) {
$css_classes[] = 'vc_row-flex';
}
$has_video_bg = ( ! empty( $video_bg ) && ! empty( $video_bg_url ) && vc_extract_youtube_id( $video_bg_url ) );
$parallax_speed = $parallax_speed_bg;
if ( $has_video_bg ) {
$parallax = $video_bg_parallax;
$parallax_speed = $parallax_speed_video;
$parallax_image = $video_bg_url;
$css_classes[] = 'vc_video-bg-container';
wp_enqueue_script( 'vc_youtube_iframe_api_js' );
}
if ( ! empty( $parallax ) ) {
wp_enqueue_script( 'vc_jquery_skrollr_js' );
$wrapper_attributes[] = 'data-vc-parallax="' . esc_attr( $parallax_speed ) . '"'; // parallax speed
$css_classes[] = 'vc_general vc_parallax vc_parallax-' . $parallax;
if ( false !== strpos( $parallax, 'fade' ) ) {
$css_classes[] = 'js-vc_parallax-o-fade';
$wrapper_attributes[] = 'data-vc-parallax-o-fade="on"';
} elseif ( false !== strpos( $parallax, 'fixed' ) ) {
$css_classes[] = 'js-vc_parallax-o-fixed';
}
}
if ( ! empty( $parallax_image ) ) {
if ( $has_video_bg ) {
$parallax_image_src = $parallax_image;
} else {
$parallax_image_id = preg_replace( '/[^\d]/', '', $parallax_image );
$parallax_image_src = wp_get_attachment_image_src( $parallax_image_id, 'full' );
if ( ! empty( $parallax_image_src[0] ) ) {
$parallax_image_src = $parallax_image_src[0];
}
}
$wrapper_attributes[] = 'data-vc-parallax-image="' . esc_attr( $parallax_image_src ) . '"';
}
if ( ! $parallax && $has_video_bg ) {
$wrapper_attributes[] = 'data-vc-video-bg="' . esc_attr( $video_bg_url ) . '"';
}
$css_class = preg_replace( '/\s+/', ' ', apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, implode( ' ', array_filter( array_unique( $css_classes ) ) ), $this->settings['base'], $atts ) );
$wrapper_attributes[] = 'class="' . esc_attr( trim( $css_class ) ) . '"';
$output .= '<div ' . implode( ' ', $wrapper_attributes ) . '>';
$output .= wpb_js_remove_wpautop( $content );
$output .= '</div>';
$output .= $after_output;
echo $output;

View File

@@ -0,0 +1,85 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $el_class
* @var $css
* @var $el_id
* @var $equal_height
* @var $content_placement
* @var $content - shortcode content
* Shortcode class
* @var WPBakeryShortCode_Vc_Row_Inner $this
*/
$el_class = $equal_height = $content_placement = $css = $el_id = '';
$disable_element = '';
$output = $after_output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$el_class = $this->getExtraClass( $el_class );
$css_classes = array(
'vc_row',
'wpb_row',
// deprecated
'vc_inner',
'vc_row-fluid',
$el_class,
vc_shortcode_custom_css_class( $css ),
);
if ( 'yes' === $disable_element ) {
if ( vc_is_page_editable() ) {
$css_classes[] = 'vc_hidden-lg vc_hidden-xs vc_hidden-sm vc_hidden-md';
} else {
return '';
}
}
if ( vc_shortcode_custom_css_has_property( $css, array(
'border',
'background',
) ) ) {
$css_classes[] = 'vc_row-has-fill';
}
if ( ! empty( $atts['gap'] ) ) {
$css_classes[] = 'vc_column-gap-' . $atts['gap'];
}
if ( ! empty( $equal_height ) ) {
$flex_row = true;
$css_classes[] = 'vc_row-o-equal-height';
}
if ( ! empty( $atts['rtl_reverse'] ) ) {
$css_classes[] = 'vc_rtl-columns-reverse';
}
if ( ! empty( $content_placement ) ) {
$flex_row = true;
$css_classes[] = 'vc_row-o-content-' . $content_placement;
}
if ( ! empty( $flex_row ) ) {
$css_classes[] = 'vc_row-flex';
}
$wrapper_attributes = array();
// build attributes for wrapper
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$css_class = preg_replace( '/\s+/', ' ', apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, implode( ' ', array_filter( array_unique( $css_classes ) ) ), $this->settings['base'], $atts ) );
$wrapper_attributes[] = 'class="' . esc_attr( trim( $css_class ) ) . '"';
$output .= '<div ' . implode( ' ', $wrapper_attributes ) . '>';
$output .= wpb_js_remove_wpautop( $content );
$output .= '</div>';
$output .= $after_output;
return $output;

View File

@@ -0,0 +1,134 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $el_class
* @var $full_width
* @var $full_height
* @var $columns_placement
* @var $content_placement
* @var $parallax
* @var $parallax_image
* @var $css
* @var $el_id
* @var $video_bg
* @var $video_bg_url
* @var $video_bg_parallax
* @var $parallax_speed_bg
* @var $parallax_speed_video
* @var $content - shortcode content
* @var $css_animation
* Shortcode class
* @var WPBakeryShortCode_Vc_Row $this
*/
$el_class = $full_height = $parallax_speed_bg = $parallax_speed_video = $full_width = $flex_row = $columns_placement = $content_placement = $parallax = $parallax_image = $css = $el_id = $video_bg = $video_bg_url = $video_bg_parallax = $css_animation = '';
$disable_element = '';
$output = $after_output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
wp_enqueue_script( 'wpb_composer_front_js' );
$el_class = $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation );
$css_classes = array(
'vc_section',
$el_class,
vc_shortcode_custom_css_class( $css ),
);
if ( 'yes' === $disable_element ) {
if ( vc_is_page_editable() ) {
$css_classes[] = 'vc_hidden-lg vc_hidden-xs vc_hidden-sm vc_hidden-md';
} else {
return '';
}
}
if ( vc_shortcode_custom_css_has_property( $css, array(
'border',
'background',
) ) || $video_bg || $parallax
) {
$css_classes[] = 'vc_section-has-fill';
}
$wrapper_attributes = array();
// build attributes for wrapper
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
if ( ! empty( $full_width ) ) {
$wrapper_attributes[] = 'data-vc-full-width="true"';
$wrapper_attributes[] = 'data-vc-full-width-init="false"';
if ( 'stretch_row_content' === $full_width ) {
$wrapper_attributes[] = 'data-vc-stretch-content="true"';
}
$after_output .= '<div class="vc_row-full-width vc_clearfix"></div>';
}
if ( ! empty( $full_height ) ) {
$css_classes[] = 'vc_row-o-full-height';
}
if ( ! empty( $content_placement ) ) {
$flex_row = true;
$css_classes[] = 'vc_section-o-content-' . $content_placement;
}
if ( ! empty( $flex_row ) ) {
$css_classes[] = 'vc_section-flex';
}
$has_video_bg = ( ! empty( $video_bg ) && ! empty( $video_bg_url ) && vc_extract_youtube_id( $video_bg_url ) );
$parallax_speed = $parallax_speed_bg;
if ( $has_video_bg ) {
$parallax = $video_bg_parallax;
$parallax_speed = $parallax_speed_video;
$parallax_image = $video_bg_url;
$css_classes[] = 'vc_video-bg-container';
wp_enqueue_script( 'vc_youtube_iframe_api_js' );
}
if ( ! empty( $parallax ) ) {
wp_enqueue_script( 'vc_jquery_skrollr_js' );
$wrapper_attributes[] = 'data-vc-parallax="' . esc_attr( $parallax_speed ) . '"'; // parallax speed
$css_classes[] = 'vc_general vc_parallax vc_parallax-' . $parallax;
if ( false !== strpos( $parallax, 'fade' ) ) {
$css_classes[] = 'js-vc_parallax-o-fade';
$wrapper_attributes[] = 'data-vc-parallax-o-fade="on"';
} elseif ( false !== strpos( $parallax, 'fixed' ) ) {
$css_classes[] = 'js-vc_parallax-o-fixed';
}
}
if ( ! empty( $parallax_image ) ) {
if ( $has_video_bg ) {
$parallax_image_src = $parallax_image;
} else {
$parallax_image_id = preg_replace( '/[^\d]/', '', $parallax_image );
$parallax_image_src = wp_get_attachment_image_src( $parallax_image_id, 'full' );
if ( ! empty( $parallax_image_src[0] ) ) {
$parallax_image_src = $parallax_image_src[0];
}
}
$wrapper_attributes[] = 'data-vc-parallax-image="' . esc_attr( $parallax_image_src ) . '"';
}
if ( ! $parallax && $has_video_bg ) {
$wrapper_attributes[] = 'data-vc-video-bg="' . esc_attr( $video_bg_url ) . '"';
}
$css_class = preg_replace( '/\s+/', ' ', apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, implode( ' ', array_filter( array_unique( $css_classes ) ) ), $this->settings['base'], $atts ) );
$wrapper_attributes[] = 'class="' . esc_attr( trim( $css_class ) ) . '"';
$output .= '<section ' . implode( ' ', $wrapper_attributes ) . '>';
$output .= wpb_js_remove_wpautop( $content );
$output .= '</section>';
$output .= $after_output;
return $output;

View File

@@ -0,0 +1,35 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var string $el_width
* @var string $style
* @var string $color
* @var string $border_width
* @var string $accent_color
* @var string $el_class
* @var string $el_id
* @var string $align
* @var string $css
* @var string $css_animation
* Shortcode class
* @var WPBakeryShortCode_Vc_Separator $this
*/
$el_width = $style = $color = $border_width = $accent_color = $el_class = $el_id = $align = $css = $css_animation = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$class_to_filter = '';
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' ) . $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
$vc_text_separator = visual_composer()->getShortCode( 'vc_text_separator' );
$atts['el_class'] = $css_class;
$atts['layout'] = 'separator_no_text';
if ( is_object( $vc_text_separator ) ) {
return $vc_text_separator->render( $atts );
}

View File

@@ -0,0 +1,237 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $source
* @var $image
* @var $custom_src
* @var $onclick
* @var $img_size
* @var $external_img_size
* @var $caption
* @var $img_link_large
* @var $link
* @var $img_link_target
* @var $alignment
* @var $el_class
* @var $el_id
* @var $css_animation
* @var $style
* @var $external_style
* @var $border_color
* @var $css
* Shortcode class
* @var WPBakeryShortCode_Vc_Single_image $this
*/
$title = $source = $image = $custom_src = $onclick = $img_size = $external_img_size = $caption = $img_link_large = $link = $img_link_target = $alignment = $el_class = $el_id = $css_animation = $style = $external_style = $border_color = $css = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$default_src = vc_asset_url( 'vc/no_image.png' );
// backward compatibility. since 4.6
if ( empty( $onclick ) && isset( $img_link_large ) && 'yes' === $img_link_large ) {
$onclick = 'img_link_large';
} elseif ( empty( $atts['onclick'] ) && ( ! isset( $atts['img_link_large'] ) || 'yes' !== $atts['img_link_large'] ) ) {
$onclick = 'custom_link';
}
if ( 'external_link' === $source ) {
$style = $external_style;
$border_color = $external_border_color;
}
$border_color = ( '' !== $border_color ) ? ' vc_box_border_' . $border_color : '';
$img = false;
switch ( $source ) {
case 'media_library':
case 'featured_image':
if ( 'featured_image' === $source ) {
$post_id = get_the_ID();
if ( $post_id && has_post_thumbnail( $post_id ) ) {
$img_id = get_post_thumbnail_id( $post_id );
} else {
$img_id = 0;
}
} else {
$img_id = preg_replace( '/[^\d]/', '', $image );
}
// set rectangular
if ( preg_match( '/_circle_2$/', $style ) ) {
$style = preg_replace( '/_circle_2$/', '_circle', $style );
$img_size = $this->getImageSquareSize( $img_id, $img_size );
}
if ( ! $img_size ) {
$img_size = 'medium';
}
$img = wpb_getImageBySize( array(
'attach_id' => $img_id,
'thumb_size' => $img_size,
'class' => 'vc_single_image-img',
) );
// don't show placeholder in public version if post doesn't have featured image
if ( 'featured_image' === $source ) {
if ( ! $img && 'page' === vc_manager()->mode() ) {
return;
}
}
break;
case 'external_link':
$dimensions = vc_extract_dimensions( $external_img_size );
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
$custom_src = $custom_src ? $custom_src : $default_src;
$img = array(
'thumbnail' => '<img class="vc_single_image-img" ' . $hwstring . ' src="' . esc_url( $custom_src ) . '" />',
);
break;
default:
$img = false;
}
if ( ! $img ) {
$img['thumbnail'] = '<img class="vc_img-placeholder vc_single_image-img" src="' . esc_url( $default_src ) . '" />';
}
$el_class = $this->getExtraClass( $el_class );
// backward compatibility
if ( vc_has_class( 'prettyphoto', $el_class ) ) {
$onclick = 'link_image';
}
// backward compatibility. will be removed in 4.7+
if ( ! empty( $atts['img_link'] ) ) {
$link = $atts['img_link'];
if ( ! preg_match( '/^(https?\:\/\/|\/\/)/', $link ) ) {
$link = 'http://' . $link;
}
}
// backward compatibility
if ( in_array( $link, array(
'none',
'link_no',
), true ) ) {
$link = '';
}
$a_attrs = array();
switch ( $onclick ) {
case 'img_link_large':
if ( 'external_link' === $source ) {
$link = $custom_src;
} else {
$link = wp_get_attachment_image_src( $img_id, 'large' );
$link = $link[0];
}
break;
case 'link_image':
wp_enqueue_script( 'prettyphoto' );
wp_enqueue_style( 'prettyphoto' );
$a_attrs['class'] = 'prettyphoto';
$a_attrs['data-rel'] = 'prettyPhoto[rel-' . get_the_ID() . '-' . wp_rand() . ']';
// backward compatibility
if ( ! vc_has_class( 'prettyphoto', $el_class ) && 'external_link' === $source ) {
$link = $custom_src;
} elseif ( ! vc_has_class( 'prettyphoto', $el_class ) ) {
$link = wp_get_attachment_image_src( $img_id, 'large' );
$link = $link[0];
}
break;
case 'custom_link':
// $link is already defined
break;
case 'zoom':
wp_enqueue_script( 'vc_image_zoom' );
if ( 'external_link' === $source ) {
$large_img_src = $custom_src;
} else {
$large_img_src = wp_get_attachment_image_src( $img_id, 'large' );
if ( $large_img_src ) {
$large_img_src = $large_img_src[0];
}
}
$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 );
}
$wrapperClass = 'vc_single_image-wrapper ' . $style . ' ' . $border_color;
if ( $link ) {
$a_attrs['href'] = $link;
$a_attrs['target'] = $img_link_target;
if ( ! empty( $a_attrs['class'] ) ) {
$wrapperClass .= ' ' . $a_attrs['class'];
unset( $a_attrs['class'] );
}
$html = '<a ' . vc_stringify_attributes( $a_attrs ) . ' class="' . $wrapperClass . '">' . $img['thumbnail'] . '</a>';
} else {
$html = '<div class="' . $wrapperClass . '">' . $img['thumbnail'] . '</div>';
}
$class_to_filter = 'wpb_single_image wpb_content_element vc_align_' . $alignment . ' ' . $this->getCSSAnimation( $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' ), true ) && 'yes' === $add_caption ) {
$img_id = apply_filters( 'wpml_object_id', $img_id, 'attachment' );
$post = get_post( $img_id );
$caption = $post->post_excerpt;
} else {
if ( 'external_link' === $source ) {
$add_caption = 'yes';
}
}
if ( 'yes' === $add_caption && '' !== $caption ) {
$html .= '<figcaption class="vc_figure-caption">' . esc_html( $caption ) . '</figcaption>';
}
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '
<div ' . implode( ' ', $wrapper_attributes ) . ' class="' . esc_attr( trim( $css_class ) ) . '">
' . wpb_widget_title( array(
'title' => $title,
'extraclass' => 'wpb_singleimage_heading',
) ) . '
<figure class="wpb_wrapper vc_figure">
' . $html . '
</figure>
</div>
';
return $output;

View File

@@ -0,0 +1,29 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $tab_id
* @var $title
* @var $content - shortcode content
* Shortcode class
* @var WPBakeryShortCode_Vc_Tab $this
*/
$tab_id = $title = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
wp_enqueue_script( 'jquery_ui_tabs_rotate' );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_tab ui-tabs-panel wpb_ui-tabs-hide vc_clearfix', $this->settings['base'], $atts );
$output = '
<div id="tab-' . ( empty( $tab_id ) ? sanitize_title( $title ) : esc_attr( $tab_id ) ) . '" class="' . esc_attr( $css_class ) . '">
' . ( ( '' === trim( $content ) ) ? esc_html__( 'Empty tab. Edit page to add content here.', 'js_composer' ) : wpb_js_remove_wpautop( $content ) ) . '
</div>
';
return $output;

View File

@@ -0,0 +1,71 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $interval
* @var $el_class
* @var $content - shortcode content
* Shortcode class
* @var WPBakeryShortCode_Vc_Tabs $this
*/
$title = $interval = $el_class = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
wp_enqueue_script( 'jquery-ui-tabs' );
$el_class = $this->getExtraClass( $el_class );
$element = 'wpb_tabs';
if ( 'vc_tour' === $this->shortcode ) {
$element = 'wpb_tour';
}
// Extract tab titles
preg_match_all( '/vc_tab([^\]]+)/i', $content, $matches, PREG_OFFSET_CAPTURE );
$tab_titles = array();
/**
* vc_tabs
*
*/
if ( isset( $matches[1] ) ) {
$tab_titles = $matches[1];
}
$tabs_nav = '';
$tabs_nav .= '<ul class="wpb_tabs_nav ui-tabs-nav vc_clearfix">';
foreach ( $tab_titles as $tab ) {
$tab_atts = shortcode_parse_atts( $tab[0] );
if ( isset( $tab_atts['title'] ) ) {
$tabs_nav .= '<li><a href="#tab-' . ( isset( $tab_atts['tab_id'] ) ? $tab_atts['tab_id'] : sanitize_title( $tab_atts['title'] ) ) . '">' . $tab_atts['title'] . '</a></li>';
}
}
$tabs_nav .= '</ul>';
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, trim( $element . ' wpb_content_element ' . $el_class ), $this->settings['base'], $atts );
if ( 'vc_tour' === $this->shortcode ) {
$next_prev_nav = '<div class="wpb_tour_next_prev_nav vc_clearfix"> <span class="wpb_prev_slide"><a href="#prev" title="' . esc_attr__( 'Previous tab', 'js_composer' ) . '">' . esc_html__( 'Previous tab', 'js_composer' ) . '</a></span> <span class="wpb_next_slide"><a href="#next" title="' . esc_attr__( 'Next tab', 'js_composer' ) . '">' . esc_html__( 'Next tab', 'js_composer' ) . '</a></span></div>';
} else {
$next_prev_nav = '';
}
$output = '
<div class="' . $css_class . '" data-interval="' . $interval . '">
<div class="wpb_wrapper wpb_tour_tabs_wrapper ui-tabs vc_clearfix">
' . wpb_widget_title( array(
'title' => $title,
'extraclass' => $element . '_heading',
) )
. $tabs_nav
. wpb_js_remove_wpautop( $content )
. $next_prev_nav . '
</div>
</div>
';
return $output;

View File

@@ -0,0 +1,87 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title_align
* @var $el_width
* @var $style
* @var $title
* @var $align
* @var $color
* @var $accent_color
* @var $el_class
* @var $el_id
* @var $layout
* @var $css
* @var $border_width
* @var $add_icon
* Icons:
* @var $i_type
* @var $i_icon_fontawesome
* @var $i_icon_openiconic
* @var $i_icon_typicons
* @var $i_icon_entypo
* @var $i_icon_linecons
* @var $i_color
* @var $i_custom_color
* @var $i_background_style
* @var $i_background_color
* @var $i_custom_background_color
* @var $i_size
* @var $i_css_animation
* @var $css_animation
* Shortcode class
* @var WPBakeryShortcode_Vc_Text_Separator $this
*/
$title_align = $el_width = $style = $title = $align = $color = $accent_color = $el_class = $el_id = $layout = $css = $border_width = $add_icon = $i_type = $i_icon_fontawesome = $i_icon_openiconic = $i_icon_typicons = $i_icon_entypo = $i_icon_linecons = $i_color = $i_custom_color = $i_background_style = $i_background_color = $i_custom_background_color = $i_size = $i_css_animation = $css_animation = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$class = 'vc_separator wpb_content_element';
$class .= ( '' !== $title_align ) ? ' vc_' . $title_align : '';
$class .= ( '' !== $el_width ) ? ' vc_sep_width_' . $el_width : ' vc_sep_width_100';
$class .= ( '' !== $style ) ? ' vc_sep_' . $style : '';
$class .= ( '' !== $border_width ) ? ' vc_sep_border_width_' . $border_width : '';
$class .= ( '' !== $align ) ? ' vc_sep_pos_' . $align : '';
$class .= ( 'separator_no_text' === $layout ) ? ' vc_separator_no_text' : '';
if ( '' !== $color && 'custom' !== $color ) {
$class .= ' vc_sep_color_' . $color;
}
$inline_css = ( 'custom' === $color && '' !== $accent_color ) ? ' style="' . vc_get_css_color( 'border-color', $accent_color ) . '"' : '';
$class_to_filter = $class;
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' ) . $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
$css_class = esc_attr( trim( $css_class ) );
$icon = '';
if ( 'true' === $add_icon ) {
vc_icon_element_fonts_enqueue( $i_type );
$icon = $this->getVcIcon( $atts );
}
$content = '';
if ( $icon ) {
$content = $icon;
}
if ( '' !== $title && 'separator_no_text' !== $layout ) {
$css_class .= ' vc_separator-has-text';
$content .= '<h4>' . $title . '</h4>';
}
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$wrapper_attributes_html = implode( ' ', $wrapper_attributes );
$separatorHtml = <<<TEMPLATE
<div class="$css_class" $wrapper_attributes_html><span class="vc_sep_holder vc_sep_holder_l"><span $inline_css class="vc_sep_line"></span></span>$content<span class="vc_sep_holder vc_sep_holder_r"><span $inline_css class="vc_sep_line"></span></span>
</div>
TEMPLATE;
return $separatorHtml;

View File

@@ -0,0 +1,55 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $el_class
* @var $style
* @var $color
* @var $size
* @var $open
* @var $css_animation
* @var $el_id
* @var $content - shortcode content
* @var $css
* Shortcode class
* @var WPBakeryShortCode_Vc_Toggle $this
*/
$title = $el_class = $style = $color = $size = $open = $css_animation = $css = $el_id = '';
$inverted = false;
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
// checking is color inverted
$style = str_replace( '_outline', '', $style, $inverted );
/**
* @since 4.4
*/
$elementClass = array(
'base' => apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'vc_toggle', $this->settings['base'], $atts ),
// TODO: check this code, don't know how to get base class names from params
'style' => 'vc_toggle_' . $style,
'color' => ( $color ) ? 'vc_toggle_color_' . $color : '',
'inverted' => ( $inverted ) ? 'vc_toggle_color_inverted' : '',
'size' => ( $size ) ? 'vc_toggle_size_' . $size : '',
'open' => ( 'true' === $open ) ? 'vc_toggle_active' : '',
'extra' => $this->getExtraClass( $el_class ),
'css_animation' => $this->getCSSAnimation( $css_animation ),
// TODO: remove getCssAnimation as function in helpers
);
$class_to_filter = trim( implode( ' ', $elementClass ) );
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
$heading_output = apply_filters( 'wpb_toggle_heading', $this->getHeading( $atts ), array(
'title' => $title,
'open' => $open,
) );
$output = '<div ' . ( isset( $el_id ) && ! empty( $el_id ) ? 'id="' . esc_attr( $el_id ) . '"' : '' ) . ' class="' . esc_attr( $css_class ) . '"><div class="vc_toggle_title">' . $heading_output . '<i class="vc_toggle_icon"></i></div><div class="vc_toggle_content">' . wpb_js_remove_wpautop( apply_filters( 'the_content', $content ), true ) . '</div></div>';
return $output;

View File

@@ -0,0 +1,48 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $content - shortcode content
* @var $el_class
* @var $el_id
* @var WPBakeryShortCode_Vc_Tta_Accordion|WPBakeryShortCode_Vc_Tta_Tabs|WPBakeryShortCode_Vc_Tta_Tour|WPBakeryShortCode_Vc_Tta_Pageable $this
*/
$el_class = $css = $css_animation = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
$this->resetVariables( $atts, $content );
extract( $atts );
$this->setGlobalTtaInfo();
$this->enqueueTtaStyles();
$this->enqueueTtaScript();
// It is required to be before tabs-list-top/left/bottom/right for tabs/tours
$prepareContent = $this->getTemplateVariable( 'content' );
$class_to_filter = $this->getTtaGeneralClasses();
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' ) . $this->getCSSAnimation( $css_animation );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
$output = '<div ' . $this->getWrapperAttributes() . '>';
$output .= $this->getTemplateVariable( 'title' );
$output .= '<div class="' . esc_attr( $css_class ) . '">';
$output .= $this->getTemplateVariable( 'tabs-list-top' );
$output .= $this->getTemplateVariable( 'tabs-list-left' );
$output .= '<div class="vc_tta-panels-container">';
$output .= $this->getTemplateVariable( 'pagination-top' );
$output .= '<div class="vc_tta-panels">';
$output .= $prepareContent;
$output .= '</div>';
$output .= $this->getTemplateVariable( 'pagination-bottom' );
$output .= '</div>';
$output .= $this->getTemplateVariable( 'tabs-list-bottom' );
$output .= $this->getTemplateVariable( 'tabs-list-right' );
$output .= '</div>';
$output .= '</div>';
return $output;

View File

@@ -0,0 +1,40 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $el_id
* @var $el_class
* @var $content - shortcode content
* @var WPBakeryShortCode_Vc_Tta_Section $this
*/
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
$this->resetVariables( $atts, $content );
WPBakeryShortCode_Vc_Tta_Section::$self_count ++;
WPBakeryShortCode_Vc_Tta_Section::$section_info[] = $atts;
$isPageEditable = vc_is_page_editable();
$output = '';
$wrapper_attributes = array();
if ( ! empty( $atts['el_id'] ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $atts['el_id'] ) . '"';
}
$output .= '<div ' . implode( ' ', $wrapper_attributes ) . ' class="' . esc_attr( $this->getElementClasses() ) . '"';
$output .= ' id="' . esc_attr( $this->getTemplateVariable( 'tab_id' ) ) . '"';
$output .= ' data-vc-content=".vc_tta-panel-body">';
$output .= '<div class="vc_tta-panel-body">';
if ( $isPageEditable ) {
$output .= '<div data-js-panel-body>'; // fix for fe - shortcodes container, not required in b.e.
}
$output .= $this->getTemplateVariable( 'basic-heading' );
$output .= $this->getTemplateVariable( 'content' );
if ( $isPageEditable ) {
$output .= '</div>';
}
$output .= '</div>';
$output .= '</div>';
return $output;

View File

@@ -0,0 +1,37 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $content - shortcode content
* @var WPBakeryShortCode_Vc_Tta_Section $this
*/
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
$this->resetVariables( $atts, $content );
WPBakeryShortCode_Vc_Tta_Section::$self_count ++;
WPBakeryShortCode_Vc_Tta_Section::$section_info[] = $atts;
$isPageEditable = vc_is_page_editable();
$output = '';
$output .= '<div class="' . esc_attr( $this->getElementClasses() ) . '"';
$output .= ' id="' . esc_attr( $this->getTemplateVariable( 'tab_id' ) ) . '"';
$output .= ' data-vc-content=".vc_tta-panel-body">';
$output .= '<div class="vc_tta-panel-heading">';
$output .= $this->getTemplateVariable( 'heading' );
$output .= '</div>';
$output .= '<div class="vc_tta-panel-body">';
if ( $isPageEditable ) {
$output .= '<div data-js-panel-body>'; // fix for fe - shortcodes container, not required in b.e.
}
$output .= $this->getTemplateVariable( 'content' );
if ( $isPageEditable ) {
$output .= '</div>';
}
$output .= '</div>';
$output .= '</div>';
return $output;

View File

@@ -0,0 +1,145 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* Shortcode class
* @var WPBakeryShortCode_Vc_TweetMeMe $this
*/
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
$tweet_btn_text = '';
$type = $atts['type'];
switch ( $type ) {
case 'follow':
$tweet_btn_text = esc_html__( 'Follow', 'js_composer' );
break;
case 'mention':
$tweet_btn_text = esc_html__( 'Tweet to', 'js_composer' );
break;
case 'share':
case 'hashtag':
$tweet_btn_text = esc_html__( 'Tweet', 'js_composer' );
break;
default:
$type = 'share';
$tweet_btn_text = esc_html__( 'Tweet', 'js_composer' );
break;
}
$data = array();
$classes = array();
$class_to_filter = 'vc_tweetmeme-element' . vc_shortcode_custom_css_class( $atts['css'], ' ' ) . $this->getCSSAnimation( $atts['css_animation'] ) . $this->getExtraClass( $atts['el_class'] );
$el_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->getShortcode(), $atts );
if ( ! empty( $atts['large_button'] ) ) {
$data['data-size'] = 'large';
}
$url = 'https://twitter.com/';
if ( 'share' === $type ) {
$url = 'https://twitter.com/share';
$classes[] = 'twitter-share-button';
if ( 'page_url' !== $atts['share_use_page_url'] ) {
$data['data-url'] = $atts['share_use_custom_url'];
}
if ( 'page_title' !== $atts['share_text_page_title'] ) {
$data['data-text'] = $atts['share_text_custom_text'];
}
if ( ! empty( $atts['share_via'] ) ) {
$data['data-via'] = $atts['share_via'];
}
if ( ! empty( $atts['share_recommend'] ) ) {
$data['data-related'] = $atts['share_recommend'];
}
if ( ! empty( $atts['share_hashtag'] ) ) {
$data['data-hashtags'] = $atts['share_hashtag'];
}
} elseif ( 'follow' === $type ) {
$url = 'https://twitter.com/';
$classes[] = 'twitter-follow-button';
if ( ! empty( $atts['follow_user'] ) ) {
$url .= esc_attr( $atts['follow_user'] );
$tweet_btn_text .= ' @' . esc_attr( $atts['follow_user'] );
}
if ( 'yes' !== $atts['follow_show_username'] ) {
$data['data-show-screen-name'] = 'false';
}
$data['data-show-count'] = ( ! ! $atts['show_followers_count'] ) ? 'true' : 'false';
} elseif ( 'hashtag' === $type ) {
$url = 'https://twitter.com/intent/tweet?';
$classes[] = 'twitter-hashtag-button';
$url_atts = array();
if ( ! empty( $atts['hashtag_hash'] ) ) {
$url_atts[] = 'button_hashtag=' . esc_attr( $atts['hashtag_hash'] );
$tweet_btn_text .= ' #' . esc_attr( $atts['hashtag_hash'] );
}
if ( 'yes' !== $atts['hashtag_no_default'] ) {
$url_atts[] = 'text=' . esc_attr( $atts['hashtag_custom_tweet_text'] );
}
$url .= implode( '&', $url_atts );
$rel = array();
if ( ! empty( $atts['hashtag_recommend_1'] ) ) {
$rel[] = $atts['hashtag_recommend_1'];
}
if ( ! empty( $atts['hashtag_recommend_1'] ) ) {
$rel[] = $atts['hashtag_recommend_2'];
}
if ( ! empty( $rel ) ) {
$data['data-related'] = implode( ',', $rel );
}
if ( 'yes' !== $atts['hashtag_no_url'] ) {
$data['data-url'] = $atts['hashtag_custom_tweet_url'];
}
} elseif ( 'mention' === $type ) {
$url = 'https://twitter.com/intent/tweet?';
$classes[] = 'twitter-mention-button';
$url_atts = array();
if ( ! empty( $atts['mention_tweet_to'] ) ) {
$url_atts[] = 'screen_name=' . esc_attr( $atts['mention_tweet_to'] );
$tweet_btn_text .= ' @' . esc_attr( $atts['mention_tweet_to'] );
}
if ( 'yes' !== $atts['mention_no_default'] ) {
$url_atts[] = 'text=' . esc_attr( $atts['mention_custom_tweet_text'] );
}
$url .= implode( '&', $url_atts );
$rel = array();
if ( ! empty( $atts['mention_recommend_1'] ) ) {
$rel[] = $atts['mention_recommend_1'];
}
if ( ! empty( $atts['mention_recommend_1'] ) ) {
$rel[] = $atts['mention_recommend_1'];
}
if ( ! empty( $rel ) ) {
$data['data-related'] = implode( ',', $rel );
}
}
if ( ! empty( $atts['lang'] ) ) {
$data['data-lang'] = $atts['lang'];
}
$data_imploded = array();
foreach ( $data as $k => $v ) {
$data_imploded[] = $k . '="' . esc_attr( $v ) . '"';
}
$wrapper_attributes = array();
if ( ! empty( $atts['el_id'] ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $atts['el_id'] ) . '"';
}
$wrapper = '<div ' . implode( ' ', $wrapper_attributes ) . ' class="' . esc_attr( $el_class ) . '">';
$template = '<a href="' . esc_url( $url ) . '" class="' . esc_attr( implode( ' ', $classes ) ) . '" ' . implode( ' ', $data_imploded ) . '>' . $tweet_btn_text . '</a>';
$custom_tag = 'script';
$template .= '<' . $custom_tag . '>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?\'http\':\'https\';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+\'://platform.twitter.com/widgets.js\';fjs.parentNode.insertBefore(js,fjs);}}(document, \'script\', \'twitter-wjs\');</' . $custom_tag . '>';
$wrapper .= $template;
$wrapper .= '</div>';
return $wrapper;

View File

@@ -0,0 +1,66 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $link
* @var $el_class
* @var $el_id
* @var $css
* @var $css_animation
* @var $el_width
* @var $el_aspect
* @var $align
* Shortcode class
* @var WPBakeryShortCode_Vc_Video $this
*/
$title = $link = $el_class = $el_id = $css = $css_animation = $el_width = $el_aspect = $align = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
if ( '' === $link ) {
return null;
}
$el_class = $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation );
$video_w = 500;
$video_h = $video_w / 1.61; // 1.61 golden ratio
/** @var WP_Embed $wp_embed */
global $wp_embed;
$embed = '';
if ( is_object( $wp_embed ) ) {
$embed = $wp_embed->run_shortcode( '[embed width="' . $video_w . '"' . $video_h . ']' . $link . '[/embed]' );
}
$el_classes = array(
'wpb_video_widget',
'wpb_content_element',
'vc_clearfix',
$el_class,
vc_shortcode_custom_css_class( $css, ' ' ),
'vc_video-aspect-ratio-' . esc_attr( $el_aspect ),
'vc_video-el-width-' . esc_attr( $el_width ),
'vc_video-align-' . esc_attr( $align ),
);
$css_class = implode( ' ', $el_classes );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $css_class, $this->getShortcode(), $atts );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '
<div class="' . esc_attr( $css_class ) . '" ' . implode( ' ', $wrapper_attributes ) . '>
<div class="wpb_wrapper">
' . wpb_widget_title( array(
'title' => $title,
'extraclass' => 'wpb_video_heading',
) ) . '
<div class="wpb_video_wrapper">' . $embed . '</div>
</div>
</div>
';
return $output;

View File

@@ -0,0 +1,50 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $el_class
* @var $el_id
* @var $sidebar_id
* Shortcode class
* @var WPBakeryShortCode_Vc_Widget_sidebar $this
*/
$title = $el_class = $el_id = $sidebar_id = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
if ( '' === $sidebar_id ) {
return null;
}
$el_class = $this->getExtraClass( $el_class );
ob_start();
dynamic_sidebar( $sidebar_id );
$sidebar_value = ob_get_contents();
ob_end_clean();
$sidebar_value = trim( $sidebar_value );
$sidebar_value = ( '<li' === substr( $sidebar_value, 0, 3 ) ) ? '<ul>' . $sidebar_value . '</ul>' : $sidebar_value;
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_widgetised_column wpb_content_element' . $el_class, $this->settings['base'], $atts );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '<div ' . implode( ' ', $wrapper_attributes ) . ' class="' . esc_attr( $css_class ) . '">
<div class="wpb_wrapper">
' . wpb_widget_title( array(
'title' => $title,
'extraclass' => 'wpb_widgetised_column_heading',
) ) . '
' . $sidebar_value . '
</div>
</div>
';
return $output;

View File

@@ -0,0 +1,48 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $options
* @var $el_class
* @var $el_id
* Shortcode class
* @var WPBakeryShortCode $this
*/
$title = $el_class = $el_id = $options = '';
$output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$options = explode( ',', $options );
if ( in_array( 'dropdown', $options, true ) ) {
$atts['dropdown'] = true;
}
if ( in_array( 'count', $options, true ) ) {
$atts['count'] = true;
}
$el_class = $this->getExtraClass( $el_class );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '<div ' . implode( ' ', $wrapper_attributes ) . ' class="vc_wp_archives wpb_content_element' . esc_attr( $el_class ) . '">';
$type = 'WP_Widget_Archives';
$args = array();
global $wp_widget_factory;
// to avoid unwanted warnings let's check before using widget
if ( is_object( $wp_widget_factory ) && isset( $wp_widget_factory->widgets, $wp_widget_factory->widgets[ $type ] ) ) {
ob_start();
the_widget( $type, $atts, $args );
$output .= ob_get_clean();
$output .= '</div>';
return $output;
}

View File

@@ -0,0 +1,38 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $el_class
* @var $el_id
* Shortcode class
* @var WPBakeryShortCode_Vc_Wp_Calendar $this
*/
$title = $el_class = $el_id = '';
$output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$el_class = $this->getExtraClass( $el_class );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '<div ' . implode( ' ', $wrapper_attributes ) . ' class="vc_wp_calendar wpb_content_element' . esc_attr( $el_class ) . '">';
$type = 'WP_Widget_Calendar';
$args = array();
global $wp_widget_factory;
// to avoid unwanted warnings let's check before using widget
if ( is_object( $wp_widget_factory ) && isset( $wp_widget_factory->widgets, $wp_widget_factory->widgets[ $type ] ) ) {
ob_start();
the_widget( $type, $atts, $args );
$output .= ob_get_clean();
$output .= '</div>';
return $output;
}

View File

@@ -0,0 +1,50 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $options
* @var $el_class
* @var $el_id
* Shortcode class
* @var WPBakeryShortCode_Vc_Wp_Categories $this
*/
$title = $options = $el_class = $el_id = '';
$output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$options = explode( ',', $options );
if ( in_array( 'dropdown', $options, true ) ) {
$atts['dropdown'] = true;
}
if ( in_array( 'count', $options, true ) ) {
$atts['count'] = true;
}
if ( in_array( 'hierarchical', $options, true ) ) {
$atts['hierarchical'] = true;
}
$el_class = $this->getExtraClass( $el_class );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '<div ' . implode( ' ', $wrapper_attributes ) . ' class="vc_wp_categories wpb_content_element' . esc_attr( $el_class ) . '">';
$type = 'WP_Widget_Categories';
$args = array();
global $wp_widget_factory;
// to avoid unwanted warnings let's check before using widget
if ( is_object( $wp_widget_factory ) && isset( $wp_widget_factory->widgets, $wp_widget_factory->widgets[ $type ] ) ) {
ob_start();
the_widget( $type, $atts, $args );
$output .= ob_get_clean();
$output .= '</div>';
return $output;
}

View File

@@ -0,0 +1,39 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $nav_menu
* @var $el_class
* @var $el_id
* Shortcode class
* @var WPBakeryShortCode_Vc_Wp_Custommenu $this
*/
$title = $nav_menu = $el_class = $el_id = '';
$output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$el_class = $this->getExtraClass( $el_class );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '<div ' . implode( ' ', $wrapper_attributes ) . ' class="vc_wp_custommenu wpb_content_element' . esc_attr( $el_class ) . '">';
$type = 'WP_Nav_Menu_Widget';
$args = array();
global $wp_widget_factory;
// to avoid unwanted warnings let's check before using widget
if ( is_object( $wp_widget_factory ) && isset( $wp_widget_factory->widgets, $wp_widget_factory->widgets[ $type ] ) ) {
ob_start();
the_widget( $type, $atts, $args );
$output .= ob_get_clean();
$output .= '</div>';
return $output;
}

View File

@@ -0,0 +1,55 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $category
* @var $orderby
* @var $options
* @var $limit
* @var $el_class
* @var $el_id
* Shortcode class
* @var WPBakeryShortCode_Vc_Wp_Links $this
*/
$category = $options = $orderby = $limit = $el_class = $el_id = '';
$output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$options = explode( ',', $options );
if ( in_array( 'images', $options, true ) ) {
$atts['images'] = true;
}
if ( in_array( 'name', $options, true ) ) {
$atts['name'] = true;
}
if ( in_array( 'description', $options, true ) ) {
$atts['description'] = true;
}
if ( in_array( 'rating', $options, true ) ) {
$atts['rating'] = true;
}
$el_class = $this->getExtraClass( $el_class );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '<div ' . implode( ' ', $wrapper_attributes ) . ' class="vc_wp_links wpb_content_element' . esc_attr( $el_class ) . '">';
$type = 'WP_Widget_Links';
$args = array();
global $wp_widget_factory;
// to avoid unwanted warnings let's check before using widget
if ( is_object( $wp_widget_factory ) && isset( $wp_widget_factory->widgets, $wp_widget_factory->widgets[ $type ] ) ) {
ob_start();
the_widget( $type, $atts, $args );
$output .= ob_get_clean();
$output .= '</div>';
return $output;
}

View File

@@ -0,0 +1,38 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $el_class
* @var $el_id
* Shortcode class
* @var WPBakeryShortCode_Vc_Wp_Meta $this
*/
$title = $el_class = $el_id = '';
$output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$el_class = $this->getExtraClass( $el_class );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '<div ' . implode( ' ', $wrapper_attributes ) . ' class="vc_wp_meta wpb_content_element' . esc_attr( $el_class ) . '">';
$type = 'WP_Widget_Meta';
$args = array();
global $wp_widget_factory;
// to avoid unwanted warnings let's check before using widget
if ( is_object( $wp_widget_factory ) && isset( $wp_widget_factory->widgets, $wp_widget_factory->widgets[ $type ] ) ) {
ob_start();
the_widget( $type, $atts, $args );
$output .= ob_get_clean();
$output .= '</div>';
return $output;
}

View File

@@ -0,0 +1,40 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $sortby
* @var $exclude
* @var $el_class
* @var $el_id
* Shortcode class
* @var WPBakeryShortCode_Vc_Wp_Pages $this
*/
$title = $sortby = $exclude = $el_class = $el_id = '';
$output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$el_class = $this->getExtraClass( $el_class );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '<div ' . implode( ' ', $wrapper_attributes ) . ' class="vc_wp_pages wpb_content_element' . esc_attr( $el_class ) . '">';
$type = 'WP_Widget_Pages';
$args = array();
global $wp_widget_factory;
// to avoid unwanted warnings let's check before using widget
if ( is_object( $wp_widget_factory ) && isset( $wp_widget_factory->widgets, $wp_widget_factory->widgets[ $type ] ) ) {
ob_start();
the_widget( $type, $atts, $args );
$output .= ob_get_clean();
$output .= '</div>';
return $output;
}

View File

@@ -0,0 +1,40 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $number
* @var $show_date
* @var $el_class
* @var $el_id
* Shortcode class
* @var WPBakeryShortCode_Vc_Wp_Posts $this
*/
$title = $number = $show_date = $el_class = $el_id = '';
$output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$el_class = $this->getExtraClass( $el_class );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '<div ' . implode( ' ', $wrapper_attributes ) . ' class="vc_wp_posts wpb_content_element' . esc_attr( $el_class ) . '">';
$type = 'WP_Widget_Recent_Posts';
$args = array();
global $wp_widget_factory;
// to avoid unwanted warnings let's check before using widget
if ( is_object( $wp_widget_factory ) && isset( $wp_widget_factory->widgets, $wp_widget_factory->widgets[ $type ] ) ) {
ob_start();
the_widget( $type, $atts, $args );
$output .= ob_get_clean();
$output .= '</div>';
return $output;
}

View File

@@ -0,0 +1,39 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $number
* @var $el_class
* @var $el_id
* Shortcode class
* @var WPBakeryShortCode_Vc_Wp_Recentcomments $this
*/
$title = $number = $el_class = $el_id = '';
$output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$el_class = $this->getExtraClass( $el_class );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '<div ' . implode( ' ', $wrapper_attributes ) . ' class="vc_wp_recentcomments wpb_content_element' . esc_attr( $el_class ) . '">';
$type = 'WP_Widget_Recent_Comments';
$args = array();
global $wp_widget_factory;
// to avoid unwanted warnings let's check before using widget
if ( is_object( $wp_widget_factory ) && isset( $wp_widget_factory->widgets, $wp_widget_factory->widgets[ $type ] ) ) {
ob_start();
the_widget( $type, $atts, $args );
$output .= ob_get_clean();
$output .= '</div>';
return $output;
}

View File

@@ -0,0 +1,58 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $url
* @var $items
* @var $options
* @var $el_class
* @var $el_id
* Shortcode class
* @var WPBakeryShortCode_Vc_Wp_Rss $this
*/
$title = $url = $items = $options = $el_class = $el_id = '';
$output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
$atts['url'] = html_entity_decode( $atts['url'], ENT_QUOTES ); // fix #2034
extract( $atts );
if ( '' === $url ) {
return;
}
$options = explode( ',', $options );
if ( in_array( 'show_summary', $options, true ) ) {
$atts['show_summary'] = true;
}
if ( in_array( 'show_author', $options, true ) ) {
$atts['show_author'] = true;
}
if ( in_array( 'show_date', $options, true ) ) {
$atts['show_date'] = true;
}
$el_class = $this->getExtraClass( $el_class );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '<div ' . implode( ' ', $wrapper_attributes ) . ' class="vc_wp_rss wpb_content_element' . esc_attr( $el_class ) . '">';
$type = 'WP_Widget_RSS';
$args = array();
global $wp_widget_factory;
// to avoid unwanted warnings let's check before using widget
if ( is_object( $wp_widget_factory ) && isset( $wp_widget_factory->widgets, $wp_widget_factory->widgets[ $type ] ) ) {
ob_start();
the_widget( $type, $atts, $args );
$output .= ob_get_clean();
$output .= '</div>';
return $output;
}

View File

@@ -0,0 +1,38 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $el_class
* @var $el_id
* Shortcode class
* @var WPBakeryShortCode_Vc_Wp_Search $this
*/
$title = $el_class = $el_id = '';
$output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$el_class = $this->getExtraClass( $el_class );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '<div ' . implode( ' ', $wrapper_attributes ) . ' class="vc_wp_search wpb_content_element' . esc_attr( $el_class ) . '">';
$type = 'WP_Widget_Search';
$args = array();
global $wp_widget_factory;
// to avoid unwanted warnings let's check before using widget
if ( is_object( $wp_widget_factory ) && isset( $wp_widget_factory->widgets, $wp_widget_factory->widgets[ $type ] ) ) {
ob_start();
the_widget( $type, $atts, $args );
$output .= ob_get_clean();
$output .= '</div>';
return $output;
}

View File

@@ -0,0 +1,39 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $title
* @var $taxonomy
* @var $el_class
* @var $el_id
* Shortcode class
* @var WPBakeryShortCode_Vc_Wp_Tagcloud $this
*/
$title = $taxonomy = $el_class = $el_id = '';
$output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$el_class = $this->getExtraClass( $el_class );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '<div ' . implode( ' ', $wrapper_attributes ) . ' class="vc_wp_tagcloud wpb_content_element' . esc_attr( $el_class ) . '">';
$type = 'WP_Widget_Tag_Cloud';
$args = array();
global $wp_widget_factory;
// to avoid unwanted warnings let's check before using widget
if ( is_object( $wp_widget_factory ) && isset( $wp_widget_factory->widgets, $wp_widget_factory->widgets[ $type ] ) ) {
ob_start();
the_widget( $type, $atts, $args );
$output .= ob_get_clean();
$output .= '</div>';
return $output;
}

View File

@@ -0,0 +1,43 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Shortcode attributes
* @var $atts
* @var $el_class
* @var $el_id
* @var $content - shortcode content
* Shortcode class
* @var WPBakeryShortCode_Vc_Wp_Text $this
*/
$el_class = $el_id = '';
$output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
$atts['filter'] = true; // Hack to make sure that <p> added
extract( $atts );
$el_class = $this->getExtraClass( $el_class );
$wrapper_attributes = array();
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
$output = '<div ' . implode( ' ', $wrapper_attributes ) . ' class="vc_wp_text wpb_content_element' . esc_attr( $el_class ) . '">';
$type = 'WP_Widget_Text';
$args = array();
$content = apply_filters( 'vc_wp_text_widget_shortcode', $content );
if ( strlen( $content ) > 0 ) {
$atts['text'] = $content;
}
global $wp_widget_factory;
// to avoid unwanted warnings let's check before using widget
if ( is_object( $wp_widget_factory ) && isset( $wp_widget_factory->widgets, $wp_widget_factory->widgets[ $type ] ) ) {
ob_start();
the_widget( $type, $atts, $args );
$output .= ob_get_clean();
$output .= '</div>';
return $output;
}

View File

@@ -0,0 +1,36 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/** @var array $atts */
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
$class_to_filter = 'vc-zigzag-wrapper';
$class_to_filter .= vc_shortcode_custom_css_class( $atts['css'], ' ' ) . $this->getExtraClass( $atts['el_class'] ) . $this->getCSSAnimation( $atts['css_animation'] );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
if ( ! empty( $atts['align'] ) ) {
$class_to_filter .= ' vc-zigzag-align-' . esc_attr( $atts['align'] );
}
$color = '';
if ( 'custom' !== $atts['color'] ) {
$color = vc_convert_vc_color( $atts['color'] );
} else {
$color = esc_attr( $atts['custom_color'] );
}
$width = '100%';
if ( ! empty( $atts['el_width'] ) ) {
$width = esc_attr( $atts['el_width'] ) . '%';
}
$border_width = '10';
if ( ! empty( $atts['el_border_width'] ) ) {
$border_width = esc_attr( $atts['el_border_width'] );
}
$minheight = 2 + intval( $border_width );
$svg = '<?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="' . ( intval( $border_width ) + 2 ) . 'px' . '" height="' . intval( $border_width ) . 'px' . '" viewBox="0 0 18 15" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><polygon id="Combined-Shape" fill="' . esc_attr( $color ) . '" points="8.98762301 0 0 9.12771969 0 14.519983 9 5.40479869 18 14.519983 18 9.12771969"></polygon></svg>';
$output = '';
$output .= '
<div class="' . esc_attr( $class_to_filter ) . '"' . ( ! empty( $atts['el_id'] ) ? ' id="' . esc_attr( $atts['el_id'] ) . '"' : '' ) . '><div class="vc-zigzag-inner" style="' . esc_attr( 'width: ' . esc_attr( $width ) . ';min-height: ' . $minheight . 'px;background: 0 repeat-x url(\'data:image/svg+xml;utf-8,' . rawurlencode( $svg ) . '\');' ) . '"></div></div>';
return $output;