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,82 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @var Vc_Column_Offset $param
* @var Vc_Column_Offset $sizes ::$size_types
*/
$layouts = array(
'xs' => 'portrait-smartphones',
'sm' => 'portrait-tablets',
'md' => 'landscape-tablets',
'lg' => 'default',
);
$custom_tag = 'script';
?>
<div class="vc_column-offset" data-column-offset="true">
<?php if ( '1' === vc_settings()->get( 'not_responsive_css' ) ) : ?>
<div class="wpb_alert wpb_content_element vc_alert_rounded wpb_alert-warning">
<div class="messagebox_text">
<p><?php printf( esc_html__( 'Responsive design settings are currently disabled. You can enable them in WPBakery Page Builder %ssettings page%s by unchecking "Disable responsive content elements".', 'js_composer' ), '<a href="' . esc_url( admin_url( 'admin.php?page=vc-general' ) ) . '">', '</a>' ); ?></p>
</div>
</div>
<?php endif ?>
<input name="<?php echo esc_attr( $settings['param_name'] ); ?>"
class="wpb_vc_param_value <?php echo esc_attr( $settings['param_name'] ); ?>
<?php echo esc_attr( $settings['type'] ); ?> '_field" type="hidden" value="<?php echo esc_attr( $value ); ?>"/>
<table class="vc_table vc_column-offset-table">
<tr>
<th>
<?php esc_html_e( 'Device', 'js_composer' ); ?>
</th>
<th>
<?php esc_html_e( 'Offset', 'js_composer' ); ?>
</th>
<th>
<?php esc_html_e( 'Width', 'js_composer' ); ?>
</th>
<th>
<?php esc_html_e( 'Hide on device?', 'js_composer' ); ?>
</th>
</tr>
<?php foreach ( $sizes as $key => $size ) : ?>
<tr class="vc_size-<?php echo esc_attr( $key ); ?>">
<td class="vc_screen-size vc_screen-size-<?php echo esc_attr( $key ); ?>">
<span title="<?php echo esc_attr( $size ); ?>">
<i class="vc-composer-icon vc-c-icon-layout_<?php echo isset( $layouts[ $key ] ) ? esc_attr( $layouts[ $key ] ) : esc_attr( $key ); ?>"></i>
</span>
</td>
<td>
<?php
// @codingStandardsIgnoreLine
print $param->offsetControl( $key );
?>
</td>
<td>
<?php
// @codingStandardsIgnoreLine
print $param->sizeControl( $key );
?>
</td>
<td>
<label>
<input type="checkbox" name="vc_hidden-<?php echo esc_attr( $key ); ?>"
value="yes"<?php echo in_array( 'vc_hidden-' . $key, $data, true ) ? ' checked="true"' : ''; ?>
class="vc_column_offset_field">
</label>
</td>
</tr>
<?php endforeach ?>
</table>
</div>
<<?php echo esc_attr( $custom_tag ); ?>>
window.VcI8nColumnOffsetParam =
<?php
echo wp_json_encode( array(
'inherit' => esc_html__( 'Inherit: ', 'js_composer' ),
'inherit_default' => esc_html__( 'Inherit from default', 'js_composer' ),
) )
?>
;
</<?php echo esc_attr( $custom_tag ); ?>>

View File

@@ -0,0 +1,51 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
?>
<div class="vc_row-fluid vc_column">
<div class="wpb_element_label"><?php esc_html_e( 'Font Family', 'js_composer' ); ?></div>
<div class="vc_google_fonts_form_field-font_family-container">
<select class="vc_google_fonts_form_field-font_family-select"
default[font_style]="<?php echo esc_attr( $values['font_style'] ); ?>">
<?php
/** @var Vc_Google_Fonts $this */
$fonts = $this->_vc_google_fonts_get_fonts();
foreach ( $fonts as $font_data ) :
?>
<option value="<?php echo esc_attr( $font_data->font_family ) . ':' . esc_attr( $font_data->font_styles ); ?>"
data[font_types]="<?php echo esc_attr( $font_data->font_types ); ?>"
data[font_family]="<?php echo esc_attr( $font_data->font_family ); ?>"
data[font_styles]="<?php echo esc_attr( $font_data->font_styles ); ?>"
class="<?php echo esc_attr( vc_build_safe_css_class( $font_data->font_family ) ); ?>" <?php echo( strtolower( $values['font_family'] ) === strtolower( $font_data->font_family ) || strtolower( $values['font_family'] ) === strtolower( $font_data->font_family ) . ':' . $font_data->font_styles ? 'selected' : '' ); ?> ><?php echo esc_html( $font_data->font_family ); ?></option>
<?php endforeach ?>
</select>
</div>
<?php if ( isset( $fields['font_family_description'] ) && strlen( $fields['font_family_description'] ) > 0 ) : ?>
<span class="vc_description clear"><?php echo esc_html( $fields['font_family_description'] ); ?></span>
<?php endif ?>
</div>
<?php if ( isset( $fields['no_font_style'] ) && false === $fields['no_font_style'] || ! isset( $fields['no_font_style'] ) ) : ?>
<div class="vc_row-fluid vc_column">
<div class="wpb_element_label"><?php esc_html_e( 'Font style', 'js_composer' ); ?></div>
<div class="vc_google_fonts_form_field-font_style-container">
<select class="vc_google_fonts_form_field-font_style-select"></select>
</div>
</div>
<?php if ( isset( $fields['font_style_description'] ) && strlen( $fields['font_style_description'] ) > 0 ) : ?>
<span class="vc_description clear"><?php echo esc_html( $fields['font_style_description'] ); ?></span>
<?php endif ?>
<?php endif ?>
<div class="vc_row-fluid vc_column vc_google_fonts_form_field-preview-wrapper">
<div class="wpb_element_label"><?php esc_html_e( 'Google Fonts preview', 'js_composer' ); ?>:</div>
<div class="vc_google_fonts_form_field-preview-container">
<span><?php esc_html_e( 'Grumpy wizards make toxic brew for the evil Queen and Jack.', 'js_composer' ); ?></span>
</div>
<div class="vc_google_fonts_form_field-status-container"><span></span></div>
</div>
<input name="<?php echo esc_attr( $settings['param_name'] ); ?>"
class="wpb_vc_param_value <?php echo esc_attr( $settings['param_name'] ) . ' ' . esc_attr( $settings['type'] ); ?>_field" type="hidden"
value="<?php echo esc_attr( $value ); ?>"/>

View File

@@ -0,0 +1,163 @@
<script type="text/html" id="vcl-loop-frame">
<div class="vc_row">
<div class="vc_col-sm-12">
<# if(vc.loop_field_not_hidden('post_type', loop)) { #>
<label class="wpb_element_label"><?php esc_html_e('Post types', 'js_composer') ?></label>
<div class="post-types-list">
{{{ vc.loop_partial('checkboxes', 'post_type', loop) }}}
</div>
<span class="description clear"><?php esc_html_e('Select post types to populate posts from. Note: If no post type is selected, WordPress will use default "Post" value.', 'js_composer'); ?></span>
<# } #>
</div>
</div>
<div class="vc_row">
<# if(vc.loop_field_not_hidden('size', loop)) { #>
<div class="vc_col-sm-4">
<label class="wpb_element_label"><?php esc_html_e('Post count', 'js_composer') ?></label>
{{{ vc.loop_partial('text-input', 'size', loop) }}}
<span class="description clear"><?php esc_html_e('How many teasers to show? Enter number or word "All".', 'js_composer'); ?></span>
</div>
<# } #>
<# if(vc.loop_field_not_hidden('order_by', loop)) { #>
<div class="vc_col-sm-4">
<label class="wpb_element_label"><?php esc_html_e('Order by', 'js_composer') ?></label>
{{{ vc.loop_partial('dropdown', 'order_by', loop) }}}
<span class="description clear"><?php echo sprintf(__('Select how to sort retrieved posts. More at %s.', 'js_composer'), '<a href="https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters" target="_blank">
WordPress codex page</a>'); ?></span>
</div>
<# } #>
<# if(vc.loop_field_not_hidden('order', loop)) { #>
<div class="vc_col-sm-4">
<label class="wpb_element_label"><?php esc_html_e('Sort order', 'js_composer') ?></label>
{{{ vc.loop_partial('dropdown', 'order', loop) }}}
<span class="description clear"><?php esc_html_e('Designates the ascending or descending order.', 'js_composer'); ?></span>
</div>
<# } #>
</div>
<# if(vc.loop_field_not_hidden('categories', loop)) { #>
<div class="vc_row">
<div class="vc_col-sm-12">
<div class="vc_suggest-field" data-block="suggestion">
<label class="wpb_element_label"><?php esc_html_e('Categories', 'js_composer') ?></label>
{{{ vc.loop_partial('autosuggest', 'categories', loop) }}}
<span class="description clear"><?php esc_html_e('Filter output by posts categories, enter category names here.', 'js_composer'); ?></span>
</div>
</div>
</div>
<# } #>
<# if(vc.loop_field_not_hidden('tags', loop)) { #>
<div class="vc_row">
<div class="vc_col-sm-12">
<div class="vc_suggest-field" data-block="suggestion">
<label class="wpb_element_label"><?php esc_html_e('Tags', 'js_composer') ?></label>
{{{ vc.loop_partial('autosuggest', 'tags', loop) }}}
<span class="description clear"><?php esc_html_e('Filter output by posts tags, enter tag names here.', 'js_composer'); ?></span>
</div>
</div>
</div>
<# } #>
<# if(vc.loop_field_not_hidden('tax_query', loop)) { #>
<div class="vc_row">
<div class="vc_col-sm-12">
<div class="vc_suggest-field" data-block="suggestion">
<label class="wpb_element_label"><?php esc_html_e('Taxonomies', 'js_composer') ?></label>
{{{ vc.loop_partial('autosuggest', 'tax_query', loop) }}}
<span class="description clear"><?php esc_html_e('Filter output by custom taxonomies categories, enter category names here.', 'js_composer'); ?></span>
</div>
</div>
</div>
<# } #>
<# if(vc.loop_field_not_hidden('by_id', loop)) { #>
<div class="vc_row">
<div class="vc_col-sm-12">
<div class="vc_suggest-field" data-block="suggestion">
<label class="wpb_element_label"><?php esc_html_e('Individual Posts/Pages/Custom Post Types', 'js_composer') ?></label>
{{{ vc.loop_partial('autosuggest', 'by_id', loop) }}}
<span class="description clear"><?php esc_html_e('Only entered posts/pages will be included in the output. Note: Works in conjunction with selected "Post types".', 'js_composer'); ?></span>
</div>
</div>
</div>
<# } #>
<# if(vc.loop_field_not_hidden('authors', loop)) { #>
<div class="vc_row">
<div class="vc_col-sm-12">
<div class="vc_suggest-field" data-block="suggestion">
<label class="wpb_element_label"><?php esc_html_e('Author', 'js_composer') ?></label>
{{{ vc.loop_partial('autosuggest', 'authors', loop) }}}
<span class="description clear"><?php esc_html_e('Filter by author name.', 'js_composer'); ?></span>
</div>
</div>
</div>
<# } #>
</script>
<script type="text/html" id="_vcl-text-input">
<#
var is_locked = vc.is_locked(data),
disabled = is_locked ? ' disabled="true"' : '',
value = _.isObject(data) && !_.isUndefined(data.value) ? data.value : '';
#>
<input type="text" name="{{ name }}" value="{{ value }}" class="vc_{{ name }}_field" {{ disabled }}>
</script>
<script type="text/html" id="_vcl-dropdown">
<#
var is_locked = vc.is_locked(data),
disabled = is_locked ? ' disabled="true"' : '';
#>
<select name="{{ name }}" class="vc_dropdown" {{ disabled }}>
<option value=""></option>
<# if(_.isObject(data) && _.isArray(data.options)) { #>
<#
_.each(data.options, function(opt) {
var value, label;
if(_.isArray(opt)) {
value = opt[0];
label = opt[1];
} else {
value = opt;
label = opt;
}#>
<option value="{{ value }}"
{{ data.value===value ?
' selected="true"' : '' }}>{{ label }}</option>
<#
});
#>
<# } #>
</select>
</script>
<script type="text/html" id="_vcl-checkboxes">
<#
var is_locked = vc.is_locked(data);
#>
<input type="hidden" name="{{ name }}" value="{{ data.value }}" data-name="{{ name }}">
<# if(_.isObject(data) && _.isArray(data.options)) {
_.each(data.options, function(opt) {
var value, label, params;
if(_.isArray(opt)) {
value = opt[0];
label = opt[1];
} else {
value = opt;
label = opt;
}
params = _.indexOf(data.value, value) >=0 ? ' checked="true"' : '';
if(!_.isEmpty(params) && is_locked) params += ' disabled="true"';
#>
<label><input type="checkbox" data-input="{{ name }}" value="{{ value }}" {{ params }}/> {{ label }}</label>
<#
});
} #>
</script>
<script type="text/html" id="_vcl-autosuggest">
<# limit_param = _.isObject(settings) && !_.isUndefined(settings.limit) ? ' data-limit="' + settings.limit + '"' : ''; #>
<input type="hidden" data-suggest-prefill="{{ name }}"
value="{{ _.isObject(data) && _.isArray(data.options) ? window.encodeURIComponent(JSON.stringify(data.options)) : '' }}">
<input type="hidden" name="{{ name }}"
value="{{ _.isObject(data) && _.isArray(data.value) ? data.value.join(',') : '' }}"
data-suggest-value="{{ name }}">
<input type="text" name="{{ name }}_autosuggest" value=""
placeholder="<?php esc_html_e('Click here and start typing...', 'js_composer'); ?>" class="vc_{{ name }}_field"
data-suggest="{{ name }}" {{ limit_param }}/>
</script>

View File

@@ -0,0 +1,63 @@
<script type="text/html" id="vcl-options-field-input">
<div class="vc_row">
<div class="vc_col-sm-12">
<label class="wpb_element_label">{{ label }}</label>
<input type="text" name="{{ name }}" value="{{ value[0] }}">
<div class="descr"><i>{{ description }}</i></div>
</div>
</div>
</script>
<script type="text/html" id="vcl-options-field-select">
<div class="vc_row">
<div class="vc_col-sm-12">
<label class="wpb_element_label">{{ label }}</label>
<select name="{{ name }}">
<# _.each(options, function(option) { #>
<# if(_.isArray(option)) { #>
<option value="{{ option[0] }}"
{{ value[0]===option[0] ?
' selected="true"' : '' }}>{{ option[1] }}</option>
<# } else { #>
<option value="{{ option }}"
{{ value[0]===option ?
' selected="true"' : '' }}>{{ option }}</option>
<# } #>
<# }); #>
</select>
<div class="descr"><i>{{ description }}</i></div>
</div>
</div>
</script>
<script type="text/html" id="vcl-options-field-checkbox">
<div class="vc_row">
<div class="vc_col-sm-12">
<label class="wpb_element_label">{{ label }}</label>
<div class="vc_options-checkboxes">
<# _.each(options, function(option) { #>
<label><input type="checkbox" name="{{ name }}" value="{{ option[0] }}" {{ _.indexOf(value,
option[0])> -1 ? ' checked="true"' : '' }}> {{ option[1] }}</label>
<# }); #>
</div>
<div class="descr"><i>{{ description }}</i></div>
</div>
</div>
</script>
<script type="text/html" id="vcl-options-field-boolean">
<div class="vc_row">
<div class="vc_col-sm-12">
<label class="wpb_element_label">{{ label }}</label>
<div class="vc_options-checkbox">
<label><input type="checkbox" name="{{ name }}" value="true" {{ value[0] === 'true' ? ' checked="true"' :
'' }}> <?php esc_html_e('Yes', 'js_composer') ?></label>
</div>
<div class="descr"><i>{{ description }}</i></div>
</div>
</div>
</script>
<script type="text/html" id="vcl-options-field-separator">
<h4>{{label}}</h4>
</script>

View File

@@ -0,0 +1,8 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$template = vc_include_template( 'params/param_group/inner_content.tpl.php' );
return '<li class="vc_param wpb_vc_row vc_param_group-collapsed vc_param_group-add_content-wrapper" style="display:none">' . $template . '</li>';

View File

@@ -0,0 +1,9 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$template = vc_include_template( 'params/param_group/inner_content.tpl.php' );
return '<li class="vc_param wpb_vc_row vc_param_group-collapsed">' . $template . '</li>';

View File

@@ -0,0 +1,25 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
return '
<div class="vc_controls vc_controls-row vc_clearfix vc_param_group-controls">
<a class="vc_control column_move vc_move-param" href="#" title="' . esc_attr__( 'Drag row to reorder', 'js_composer' ) . '" data-vc-control="move"><i class="vc-composer-icon vc-c-icon-dragndrop"></i></a>
<span class="vc_param-group-admin-labels"></span>
<span class="vc_row_edit_clone_delete">
<a class="vc_control column_delete vc_delete-param" href="#" title="' . esc_attr__( 'Delete this param', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-delete_empty"></i></a>
<a class="vc_control column_clone" href="#" title="' . esc_attr__( 'Clone this row', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-content_copy"></i></a>
<a class="vc_control column_toggle" href="#" title="' . esc_attr__( 'Toggle row', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-arrow_drop_down"></i></a>
</span>
</div>
<div class="wpb_element_wrapper">
<div class="vc_row vc_row-fluid wpb_row_container">
<div class="wpb_vc_column wpb_sortable vc_col-sm-12 wpb_content_holder vc_empty-column">
<div class="wpb_element_wrapper">
<div class="vc_fields vc_clearfix">
%content%
</div>
</div>
</div>
</div>
</div>';

View File

@@ -0,0 +1,48 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_Vc_Single_image' );
$atts = array();
parse_str( $data, $atts );
$el_class = $image = $img_size = $img_link = $img_link_target = $img_link_large = $title = $alignment = $css_animation = $css = '';
$image_string = '';
$img_class = new WPBakeryShortCode_Vc_Single_image( array( 'base' => 'vc_single_image' ) );
/** @var WPBakeryShortCode_Vc_Single_image $img_class */
$atts = vc_map_get_attributes( $img_class->getShortcode(), $atts );
extract( $atts );
$style = ( '' !== $style ) ? $style : '';
$border_color = ( '' !== $border_color ) ? ' vc_box_border_' . $border_color : '';
$img_id = has_post_thumbnail( $post->ID ) ? get_post_thumbnail_id( $post->ID ) : $post->ID;
$img = wpb_getImageBySize( array(
'attach_id' => $img_id,
'thumb_size' => $img_size,
'class' => 'vc_single_image-img',
) );
$img = apply_filters( 'vc_gitem_attribute_featured_image_img', $img );
if ( null === $img || false === $img ) {
return '';
}
$el_class = $img_class->getExtraClass( $el_class );
$style = preg_replace( '/_circle_2$/', '_circle', $style );
$wrapperClass = 'vc_single_image-wrapper ' . $style . ' ' . $border_color;
$link = vc_gitem_create_link_real( $atts, $post, $wrapperClass, $title );
$image_string = ! empty( $link ) ? '<' . $link . '>' . $img['thumbnail'] . '</a>' : '<div class="' . $wrapperClass . '">' . $img['thumbnail'] . '</div>';
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_single_image wpb_content_element' . $el_class . vc_shortcode_custom_css_class( $css, ' ' ), $img_class->settings( 'base' ), $atts );
$css_class .= $img_class->getCSSAnimation( $css_animation );
$css_class .= ' vc_align_' . $alignment;
$output = '
<div class="' . esc_attr( $css_class ) . '">
<figure class="wpb_wrapper vc_figure">
' . $image_string . '
</figure>
</div>
';
return $output;

View File

@@ -0,0 +1,48 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @var WPBakeryShortCode_Vc_Gitem_Post_Categories $vc_btn
* @var WP_Post $post
* @var $atts
*
*/
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_Vc_Gitem_Post_Categories' );
$categories = get_the_category();
$separator = '';
$css_class = array( 'vc_gitem-post-data' );
$css_class[] = vc_shortcode_custom_css_class( $atts['css'] );
$css_class[] = $atts['el_class'];
$css_class[] = 'vc_gitem-post-data-source-post_categories';
$style = str_replace( ',', 'comma', $atts['category_style'] );
$output = '<div class="' . esc_attr( implode( ' ', array_filter( $css_class ) ) ) . ' vc_grid-filter vc_clearfix vc_grid-filter-' . esc_attr( $style ) . ' vc_grid-filter-size-' . esc_attr( $atts['category_size'] ) . ' vc_grid-filter-center vc_grid-filter-color-' . esc_attr( $atts['category_color'] ) . '">';
$data = array();
if ( ! empty( $categories ) ) {
foreach ( $categories as $category ) {
$category_link = '';
if ( ! empty( $atts['link'] ) ) {
$category_link = 'href="' . esc_url( get_category_link( $category->term_id ) ) . '" alt="' . sprintf( esc_attr__( 'View all posts in %s', 'js_composer' ), $category->name ) . '"';
}
$wrapper = '<div class="vc_grid-filter-item vc_gitem-post-category-name">';
$content = esc_html( $category->name );
if ( ! empty( $category_link ) ) {
$content = '<span class="vc_gitem-post-category-name"><a ' . $category_link . ' class="vc_gitem-link">' . $content . '</a>' . '</span>';
} else {
$content = '<span class="vc_gitem-post-category-name">' . $content . '</span>';
}
$wrapper_end = '</div>';
$data[] = $wrapper . $content . $wrapper_end;
}
}
if ( empty( $atts['category_style'] ) || ' ' === $atts['category_style'] || ', ' === $atts['category_style'] ) {
$separator = $atts['category_style'];
}
$output .= implode( $separator, $data );
$output .= '</div>';
return $output;

View File

@@ -0,0 +1,238 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @var WPBakeryShortCode_Vc_Btn $vc_btn
* @var WP_Post $post
* @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 ;
*/
$atts = array();
parse_str( $data, $atts );
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_Vc_Btn' );
$vc_btn = new WPBakeryShortCode_Vc_Btn( array( 'base' => 'vc_btn' ) );
$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();
/** @var WPBakeryShortCode_Vc_Btn $vc_btn */
$atts = vc_map_get_attributes( $vc_btn->getShortcode(), $atts );
extract( $atts );
// parse link
$link = trim( $link );
$use_link = strlen( $link ) > 0 && 'none' !== $link;
$wrapper_classes = array(
'vc_btn3-container',
$vc_btn->getExtraClass( $el_class ),
$vc_btn->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, $vc_btn->settings( 'base' ), $atts );
if ( $button_classes ) {
$button_classes = esc_attr( apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, implode( ' ', array_filter( $button_classes ) ), $vc_btn->settings( 'base' ), $atts ) );
$attributes[] = 'class="' . trim( $button_classes ) . '"';
}
if ( $use_link ) {
$link_output = vc_gitem_create_link_real( $atts, $post, 'vc_general vc_btn3 ' . trim( $button_classes ), $title );
$attributes[] = $link_output;
}
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 ) {
if ( preg_match( '/href=\"[^\"]+/', $link_output ) ) {
$output .= '<a ' . $attributes . '>' . $button_html . '</a>';
} elseif ( 'load-more-grid' === $link ) {
$output .= '<a href="javascript:;" ' . $attributes . '>' . $button_html . '</a>';
}
} else {
$output .= '<button ' . $attributes . '>' . $button_html . '</button>';
}
$output .= '</div>';
return $output;

View File

@@ -0,0 +1,55 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/editor/popups/class-vc-add-element-box-grid-item.php' );
$add_element_box = new Vc_Add_Element_Box_Grid_Item();
$add_element_box->render();
// Edit form for mapped shortcode.
visual_composer()->editForm()->render();
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/editor/popups/class-vc-templates-editor-grid-item.php' );
$templates_editor = new Vc_Templates_Editor_Grid_Item();
$templates_editor->renderUITemplate();
$grid_item = new Vc_Grid_Item();
$shortcodes = $grid_item->shortcodes();
if ( vc_user_access()->part( 'presets' )->can()->get() ) {
require_once vc_path_dir( 'AUTOLOAD_DIR', 'class-vc-settings-presets.php' );
$vc_vendor_settings_presets = Vc_Settings_Preset::listDefaultVendorSettingsPresets();
$vc_all_presets = Vc_Settings_Preset::listAllPresets();
} else {
$vc_vendor_settings_presets = array();
$vc_all_presets = array();
}
$custom_tag = 'script';
?>
<<?php echo esc_attr( $custom_tag ); ?>>
window.vc_user_mapper = <?php echo wp_json_encode( WpbMap_Grid_Item::getGitemUserShortCodes() ); ?>;
window.vc_mapper = <?php echo wp_json_encode( WpbMap_Grid_Item::getShortCodes() ); ?>;
window.vc_vendor_settings_presets = <?php echo wp_json_encode( $vc_vendor_settings_presets ); ?>;
window.vc_all_presets = <?php echo wp_json_encode( $vc_all_presets ); ?>;
window.vc_frontend_enabled = false;
window.vc_mode = '<?php echo esc_js( vc_mode() ); ?>';
window.vcAdminNonce = '<?php echo esc_js( vc_generate_nonce( 'vc-admin-nonce' ) ); ?>';
</<?php echo esc_attr( $custom_tag ); ?>>
<<?php echo esc_attr( $custom_tag ); ?> type="text/html" id="vc_settings-image-block">
<li class="added">
<div class="inner" style="width: 80px; height: 80px; overflow: hidden;text-align: center;">
<img rel="{{ id }}" src="<# if(sizes && sizes.thumbnail) { #>{{ sizes.thumbnail.url }}<# } else {#>{{ url }}<# } #>"/>
</div>
<a href="#" class="vc_icon-remove"><i class="vc-composer-icon vc-c-icon-close"></i></a>
</li>
</<?php echo esc_attr( $custom_tag ); ?>>
<?php foreach ( WpbMap_Grid_Item::getShortCodes() as $sc_base => $el ) : ?>
<<?php echo esc_attr( $custom_tag ); ?> type="text/html" id="vc_shortcode-template-<?php echo esc_attr( $sc_base ); ?>">
<?php
// @codingStandardsIgnoreLine
print visual_composer()->getShortCode( $sc_base )->template();
?>
</<?php echo esc_attr( $custom_tag ); ?>>
<?php endforeach ?>
<?php
vc_include_template( 'editors/partials/access-manager-js.tpl.php' );

View File

@@ -0,0 +1,68 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/editor/navbar/class-vc-navbar-grid-item.php' );
$nav_bar = new Vc_Navbar_Grid_Item( $post );
$nav_bar->render();
$custom_tag = 'script';
?>
<div class="metabox-composer-content">
<div id="visual_composer_content" class="wpb_main_sortable main_wrapper"
data-type="<?php echo esc_attr( get_post_type() ); ?>"></div>
<div id="vc_gitem-preview" class="main_wrapper vc_gitem-preview" data-vc-grid-item="preview">
</div>
</div>
<input type="hidden" id="wpb_vc_js_status" name="wpb_vc_js_status" value="true"/>
<input type="hidden" id="wpb_vc_loading" name="wpb_vc_loading"
value="<?php esc_html_e( 'Loading, please wait...', 'js_composer' ); ?>"/>
<input type="hidden" id="wpb_vc_loading_row" name="wpb_vc_loading_row"
value="<?php esc_html_e( 'Crunching...', 'js_composer' ); ?>"/>
<input type="hidden" name="vc_grid_item_editor" value="true"/>
<<?php echo esc_attr( $custom_tag ); ?>>
window.vc_post_id = <?php echo get_the_ID(); ?>;
<?php
$vc_gitem_template = vc_request_param( 'vc_gitem_template' );
$template = Vc_Grid_Item::predefinedTemplate( $vc_gitem_template );
if ( strlen( $vc_gitem_template ) && $template ) {
echo "var vcDefaultGridItemContent = '" . esc_attr( $template['template'] ) . "';";
} else {
?>
/**
* Get content of grid item editor of current post. Data is used as models collection of shortcodes.
* Data always wrapped with vc_gitem shortcode.
* @return {*}
*/
var vcDefaultGridItemContent = '' +
'[vc_gitem]' +
'[vc_gitem_animated_block]' +
'[vc_gitem_zone_a]' +
'[vc_gitem_row position="top"]' +
'[vc_gitem_col width="1/1"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[vc_gitem_row position="middle"]' +
'[vc_gitem_col width="1/2"][/vc_gitem_col]' +
'[vc_gitem_col width="1/2"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[vc_gitem_row position="bottom"]' +
'[vc_gitem_col width="1/1"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[/vc_gitem_zone_a]' +
'[vc_gitem_zone_b]' +
'[vc_gitem_row position="top"]' +
'[vc_gitem_col width="1/1"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[vc_gitem_row position="middle"]' +
'[vc_gitem_col width="1/2"][/vc_gitem_col]' +
'[vc_gitem_col width="1/2"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[vc_gitem_row position="bottom"]' +
'[vc_gitem_col width="1/1"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[/vc_gitem_zone_b]' +
'[/vc_gitem_animated_block]' +
'[/vc_gitem]';
<?php
}
?>
</<?php echo esc_attr( $custom_tag ); ?>>

View File

@@ -0,0 +1,130 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
vc_grid_item_map_shortcodes();
do_action( 'vc-render-templates-preview-template' );
/** @var Vc_Grid_Item_Editor $vc_grid_item_editor */
global $vc_grid_item_editor;
if ( $vc_grid_item_editor ) {
$vc_grid_item_editor->registerBackendCss();
$vc_grid_item_editor->registerBackendJavascript();
add_filter( 'admin_body_class', array( $vc_grid_item_editor->templatesEditor(), 'addBodyClassTemplatePreview' ) );
add_action( 'admin_enqueue_scripts', array( &$vc_grid_item_editor, 'enqueueEditorScripts' ) );
add_action( 'admin_footer', array( &$vc_grid_item_editor, 'renderEditorFooter' ) );
add_filter( 'vc_wpbakery_shortcode_get_controls_list', array( $vc_grid_item_editor, 'shortcodesControls' ) );
}
add_action( 'admin_enqueue_scripts', array( visual_composer()->templatesPanelEditor(), 'enqueuePreviewScripts' ) );
global $menu, $submenu, $parent_file, $post_ID, $post, $post_type;
$post_ID = $editorPost->ID;
$post_type = $editorPost->post_type;
$post_title = trim( $editorPost->post_title );
$nonce_action = $nonce_action = 'update-post_' . $post_ID;
$user_ID = isset( $current_user ) && isset( $current_user->ID ) ? (int) $current_user->ID : 0;
$form_action = 'editpost';
$menu = array();
remove_action( 'wp_head', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
add_thickbox();
wp_enqueue_media( array( 'post' => $post_ID ) );
visual_composer()->templatesPanelEditor()->registerPreviewScripts();
require_once ABSPATH . 'wp-admin/admin-header.php';
$custom_tag = 'script';
$first_tag = 'style';
?>
<<?php echo esc_attr( $first_tag ); ?>>
#screen-meta, #adminmenumain, .notice, #wpfooter, #message, .updated {
display: none !important;
}
#wpcontent {
margin-left: 0 !important;
padding-left: 0 !important;
}
.vc_not-remove-overlay {
position: fixed !important;
width: 100%;
height: 100%;
z-index: 199999999;
}
html {
overflow: hidden;
background: transparent;
}
</<?php echo esc_attr( $first_tag ); ?>>
<div class="vc_not-remove-overlay"></div>
<div class="vc_ui-template-preview">
<textarea id="content" style="display: none;">
<?php
// @codingStandardsIgnoreLine
print $content;
?>
</textarea>
<div id="wpb_visual_composer" class="postbox " style="display: block;">
<div class="inside">
<div class="metabox-composer-content">
<div id="visual_composer_content" class="wpb_main_sortable main_wrapper ui-sortable ui-droppable"></div>
<div id="vc_no-content-helper" class="vc_welcome"></div>
</div>
<input type="hidden" name="vc_js_composer_group_access_show_rule" class="vc_js_composer_group_access_show_rule" value="all">
<input type="hidden" id="wpb_vc_js_status" name="wpb_vc_js_status" value="true">
<input type="hidden" id="wpb_vc_loading" name="wpb_vc_loading" value="Loading, please wait...">
<input type="hidden" id="wpb_vc_loading_row" name="wpb_vc_loading_row" value="Crunching...">
<input type="hidden" name="vc_grid_item_editor" value="true"/>
<input type="hidden" name="vc_post_custom_css" id="vc_post-custom-css" value="" autocomplete="off">
</div>
</div>
<input type="hidden" id="wpb_vc_loading" name="wpb_vc_loading" value="<?php esc_attr_e( 'Loading, please wait...', 'js_composer' ); ?>"/>
<input type="hidden" id="wpb_vc_loading_row" name="wpb_vc_loading_row" value="<?php esc_attr_e( 'Crunching...', 'js_composer' ); ?>"/>
</div>
<<?php echo esc_attr( $custom_tag ); ?>>
/**
* Get content of grid item editor of current post. Data is used as models collection of shortcodes.
* Data always wrapped with vc_gitem shortcode.
* @return {*}
*/
var vcDefaultGridItemContent = '' +
'[vc_gitem]' +
'[vc_gitem_animated_block]' +
'[vc_gitem_zone_a]' +
'[vc_gitem_row position="top"]' +
'[vc_gitem_col width="1/1"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[vc_gitem_row position="middle"]' +
'[vc_gitem_col width="1/2"][/vc_gitem_col]' +
'[vc_gitem_col width="1/2"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[vc_gitem_row position="bottom"]' +
'[vc_gitem_col width="1/1"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[/vc_gitem_zone_a]' +
'[vc_gitem_zone_b]' +
'[vc_gitem_row position="top"]' +
'[vc_gitem_col width="1/1"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[vc_gitem_row position="middle"]' +
'[vc_gitem_col width="1/2"][/vc_gitem_col]' +
'[vc_gitem_col width="1/2"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[vc_gitem_row position="bottom"]' +
'[vc_gitem_col width="1/1"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[/vc_gitem_zone_b]' +
'[/vc_gitem_animated_block]' +
'[/vc_gitem]';
</<?php echo esc_attr( $custom_tag ); ?>>
<?php
vc_include_template( 'editors/partials/backend-shortcodes-templates.tpl.php' );
do_action( 'vc_backend_editor_render' );
do_action( 'vc_vc_grid_item_editor_render' );
do_action( 'vc_ui-template-preview' );
// fix bug #59741644518985 in firefox
// wp_dequeue_script( 'isotope' );
require_once ABSPATH . 'wp-admin/admin-footer.php';

View File

@@ -0,0 +1,91 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$custom_tag = 'script';
$first_tag = 'style';
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>"/>
<meta name="viewport" content="width=device-width"/>
<title><?php wp_title( '|', true, 'right' ); ?></title>
<?php wp_head(); ?>
<<?php echo esc_attr( $first_tag ); ?>>
body {
background-color: #FFF;
color: #000;
font-size: 12px;
}
<?php
// @codingStandardsIgnoreLine
print visual_composer()->parseShortcodesCustomCss( $shortcodes_string );
?>
.vc_gitem-preview {
margin: 60px auto;
}
.vc_gitem-preview .vc_grid-item {
display: block;
margin: 0 auto;
}
.vc_grid-item-width-dropdown {
margin-top: 10px;
text-align: center;
}
.vc_container {
margin: 0 15px;
}
img {
width: 100%;
}
</<?php echo esc_attr( $first_tag ); ?>>
</head>
<div id="vc_grid-item-primary" class="vc_grid-item-site-content">
<div id="vc_grid-item-content" role="vc_grid-item-main">
<div class="vc_gitem-preview" data-vc-grid-settings="{}">
<div class="vc_container">
<div class="vc_row">
<?php
// @codingStandardsIgnoreLine
print $grid_item->renderItem( $post );
?>
</div>
</div>
</div>
</div>
<!-- #content -->
</div>
<!-- #primary -->
<?php wp_footer(); ?>
<<?php echo esc_attr( $custom_tag ); ?>>
var currentWidth = '<?php echo esc_js( $default_width_value ); ?>',
vcSetItemWidth = function ( value ) {
jQuery( '.vc_grid-item' ).removeClass( 'vc_col-sm-' + currentWidth )
.addClass( 'vc_col-sm-' + value );
currentWidth = value;
}, changeAnimation;
changeAnimation = function ( animation ) {
var $animatedBlock, prevAnimation;
$animatedBlock = jQuery( '.vc_gitem-animated-block' );
prevAnimation = $animatedBlock.data( 'vcAnimation' );
$animatedBlock.hide()
.addClass( 'vc_gitem-animate vc_gitem-animate-' + animation )
.removeClass( 'vc_gitem-animate-' + prevAnimation )
.data( 'vcAnimation', animation );
setTimeout( function () {
$animatedBlock.show();
}, 100 );
};
jQuery( document ).ready( function ( $ ) {
window.parent.vc && window.parent.vc.app.showPreview( currentWidth );
} );
</<?php echo esc_attr( $custom_tag ); ?>>
</body>
</html>

View File

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

View File

@@ -0,0 +1,55 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$wrapper_css_class = 'vc_button-2-wrapper';
/** @var WPBakeryShortCode_Vc_Button2 $this */
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$class = 'vc_btn';
// parse link
$class .= ( '' !== $color ) ? ( ' vc_btn_' . $color . ' vc_btn-' . $color ) : '';
$class .= ( '' !== $size ) ? ( ' vc_btn_' . $size . ' vc_btn-' . $size ) : '';
$class .= ( '' !== $style ) ? ' vc_btn_' . $style : '';
$css = isset( $css ) ? $css : '';
$class_to_filter = $class;
$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 );
$link = 'class="' . esc_attr( $css_class ) . '"';
$target = '';
$rel = '';
if ( isset( $atts['link'] ) ) {
$css_class .= ' vc_gitem-link';
if ( 'custom' === $atts['link'] && ! empty( $atts['url'] ) ) {
$vc_link = vc_build_link( $atts['url'] );
if ( strlen( $vc_link['target'] ) ) {
$target = ' target="' . esc_attr( $vc_link['target'] ) . '"';
}
if ( strlen( $vc_link['rel'] ) ) {
$rel = ' rel="' . esc_attr( $vc_link['rel'] ) . '"';
}
$link = 'href="' . esc_url( $vc_link['url'] ) . '" class="' . esc_attr( $css_class ) . '"';
} elseif ( 'post_link' === $atts['link'] ) {
$link = 'href="{{ post_link_url }}" class="' . esc_attr( $css_class ) . '"';
} elseif ( 'image' === $atts['link'] ) {
$link = '{{ post_image_url_href }} class="' . esc_attr( $css_class ) . '"';
} elseif ( 'image_lightbox' === $atts['link'] ) {
$link = '{{ post_image_url_attr_prettyphoto:' . esc_attr( $css_class ) . ' }}';
}
}
$link = apply_filters( 'vc_gitem_post_data_get_link_link', 'a ' . $link, $atts, $css_class ) . apply_filters( 'vc_gitem_post_data_get_link_target', $target, $atts ) . apply_filters( 'vc_gitem_post_data_get_link_rel', $rel, $atts );
if ( $align ) {
$wrapper_css_class .= ' vc_button-2-align-' . $align;
}
$output = '<div class="' . esc_attr( $wrapper_css_class ) . '">';
$output .= '<' . $link . $target . $rel . '>' . $title . '</a>';
$output .= '</div>';
return $output;

View File

@@ -0,0 +1,48 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @var WPBakeryShortCode_Vc_Custom_heading $this
*/
extract( $this->getAttributes( $atts ) );
extract( $this->getStyles( $el_class, $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 = '';
}
$link = vc_gitem_create_link( $atts );
if ( ! empty( $link ) ) {
$text = '<' . $link . '>' . $text . '</a>';
}
if ( ( ! isset( $atts['use_theme_fonts'] ) || 'yes' !== $atts['use_theme_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 );
}
if ( ! empty( $styles ) ) {
$style = 'style="' . esc_attr( implode( ';', $styles ) ) . '"';
} else {
$style = '';
}
$output = '';
if ( apply_filters( 'vc_custom_heading_template_use_wrapper', false ) ) {
$output .= '<div class="' . esc_attr( $css_class ) . '" >';
$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 ) . '">';
$output .= $text;
$output .= '</' . $font_container_data['values']['tag'] . '>';
}
return $output;

View File

@@ -0,0 +1,57 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/** @var WPBakeryShortCode_Vc_Icon $this */
$icon = $color = $size = $align = $el_class = $custom_color = $link = $background_style = $background_color = $type = $icon_fontawesome = $icon_openiconic = $icon_typicons = $icon_entypoicons = $icon_linecons = $custom_background_color = '';
/** @var array $atts - shortcode attributes */
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$link = vc_gitem_create_link( $atts, 'vc_icon_element-link' );
$class_to_filter = $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 );
// Enqueue needed icon font.
vc_icon_element_fonts_enqueue( $type );
$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';
}
}
$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 ) . '"' : '';
$output = '';
$output .= '<div class="vc_icon_element vc_icon_element-outer' . esc_attr( $css_class ) . ' vc_icon_element-align-' . esc_attr( $align );
if ( $has_style ) {
$output .= 'vc_icon_element-have-style';
}
$output .= '">';
$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( ${'icon_' . $type} ) . '" ' . ( 'custom' === $color ? 'style="color:' . esc_attr( $custom_color ) . ' !important"' : '' ) . '></span>';
if ( strlen( $link ) > 0 ) {
$output .= '<' . $link . '></a>';
}
$output .= '</div></div>';
return $output;

View File

@@ -0,0 +1,67 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$el_class = $image = $img_size = $img_link = $img_link_target = $img_link_large = $title = $alignment = $css_animation = $css = '';
/** @var WPBakeryShortCode_Vc_Single_image $this */
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$default_src = vc_asset_url( 'vc/no_image.png' );
$style = ( '' !== $style ) ? $style : '';
$border_color = ( '' !== $border_color ) ? ' vc_box_border_' . $border_color : '';
$img_id = preg_replace( '/[^\d]/', '', $image );
switch ( $source ) {
case 'media_library':
$img = wpb_getImageBySize( array(
'attach_id' => $img_id,
'thumb_size' => $img_size,
'class' => 'vc_single_image-img',
) );
break;
case 'external_link':
$dimensions = vc_extract_dimensions( $img_size );
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
$custom_src = $custom_src ? esc_attr( $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_single_image-img" src="' . esc_url( $default_src ) . '" />';
}
$wrapperClass = 'vc_single_image-wrapper ' . $style . ' ' . $border_color;
$link = vc_gitem_create_link( $atts, $wrapperClass );
$image_string = ! empty( $link ) ? '<' . $link . '>' . $img['thumbnail'] . '</a>' : '<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 );
$output = '
<div class="' . esc_attr( $css_class ) . '">
' . wpb_widget_title( array(
'title' => $title,
'extraclass' => 'wpb_singleimage_heading',
) ) . '
<figure class="wpb_wrapper vc_figure">
' . $image_string . '
</figure>
</div>
';
return $output;