Import legacy nurinda.co.id website

This commit is contained in:
dirga committed 2026-10-01 14:27:19 +07:00
1 parent 3f59bb9038
commit 6e21646ac4
13389 files changed
+3246690

No files matched your search

@@ -0,0 +1,537 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_ParamAnimation
*
* For working with animations
* array(
* 'type' => 'animation_style',
* 'heading' => __( 'Animation', 'js_composer' ),
* 'param_name' => 'animation',
* ),
* Preview in http://daneden.github.io/animate.css/
* @since 4.4
*/
class Vc_ParamAnimation {
/**
* @since 4.4
* @var array $settings parameter settings from vc_map
*/
protected $settings;
/**
* @since 4.4
* @var string $value parameter value
*/
protected $value;
/**
* Define available animation effects
* @since 4.4
* vc_filter: vc_param_animation_style_list - to override animation styles
* array
* @return array
*/
protected function animationStyles() {
$styles = array(
array(
'values' => array(
__( 'None', 'js_composer' ) => 'none',
),
),
array(
'label' => __( 'Attention Seekers', 'js_composer' ),
'values' => array(
// text to display => value
__( 'bounce', 'js_composer' ) => array(
'value' => 'bounce',
'type' => 'other',
),
__( 'flash', 'js_composer' ) => array(
'value' => 'flash',
'type' => 'other',
),
__( 'pulse', 'js_composer' ) => array(
'value' => 'pulse',
'type' => 'other',
),
__( 'rubberBand', 'js_composer' ) => array(
'value' => 'rubberBand',
'type' => 'other',
),
__( 'shake', 'js_composer' ) => array(
'value' => 'shake',
'type' => 'other',
),
__( 'swing', 'js_composer' ) => array(
'value' => 'swing',
'type' => 'other',
),
__( 'tada', 'js_composer' ) => array(
'value' => 'tada',
'type' => 'other',
),
__( 'wobble', 'js_composer' ) => array(
'value' => 'wobble',
'type' => 'other',
),
),
),
array(
'label' => __( 'Bouncing Entrances', 'js_composer' ),
'values' => array(
// text to display => value
__( 'bounceIn', 'js_composer' ) => array(
'value' => 'bounceIn',
'type' => 'in',
),
__( 'bounceInDown', 'js_composer' ) => array(
'value' => 'bounceInDown',
'type' => 'in',
),
__( 'bounceInLeft', 'js_composer' ) => array(
'value' => 'bounceInLeft',
'type' => 'in',
),
__( 'bounceInRight', 'js_composer' ) => array(
'value' => 'bounceInRight',
'type' => 'in',
),
__( 'bounceInUp', 'js_composer' ) => array(
'value' => 'bounceInUp',
'type' => 'in',
),
),
),
array(
'label' => __( 'Bouncing Exits', 'js_composer' ),
'values' => array(
// text to display => value
__( 'bounceOut', 'js_composer' ) => array(
'value' => 'bounceOut',
'type' => 'out',
),
__( 'bounceOutDown', 'js_composer' ) => array(
'value' => 'bounceOutDown',
'type' => 'out',
),
__( 'bounceOutLeft', 'js_composer' ) => array(
'value' => 'bounceOutLeft',
'type' => 'out',
),
__( 'bounceOutRight', 'js_composer' ) => array(
'value' => 'bounceOutRight',
'type' => 'out',
),
__( 'bounceOutUp', 'js_composer' ) => array(
'value' => 'bounceOutUp',
'type' => 'out',
),
),
),
array(
'label' => __( 'Fading Entrances', 'js_composer' ),
'values' => array(
// text to display => value
__( 'fadeIn', 'js_composer' ) => array(
'value' => 'fadeIn',
'type' => 'in',
),
__( 'fadeInDown', 'js_composer' ) => array(
'value' => 'fadeInDown',
'type' => 'in',
),
__( 'fadeInDownBig', 'js_composer' ) => array(
'value' => 'fadeInDownBig',
'type' => 'in',
),
__( 'fadeInLeft', 'js_composer' ) => array(
'value' => 'fadeInLeft',
'type' => 'in',
),
__( 'fadeInLeftBig', 'js_composer' ) => array(
'value' => 'fadeInLeftBig',
'type' => 'in',
),
__( 'fadeInRight', 'js_composer' ) => array(
'value' => 'fadeInRight',
'type' => 'in',
),
__( 'fadeInRightBig', 'js_composer' ) => array(
'value' => 'fadeInRightBig',
'type' => 'in',
),
__( 'fadeInUp', 'js_composer' ) => array(
'value' => 'fadeInUp',
'type' => 'in',
),
__( 'fadeInUpBig', 'js_composer' ) => array(
'value' => 'fadeInUpBig',
'type' => 'in',
),
),
),
array(
'label' => __( 'Fading Exits', 'js_composer' ),
'values' => array(
__( 'fadeOut', 'js_composer' ) => array(
'value' => 'fadeOut',
'type' => 'out',
),
__( 'fadeOutDown', 'js_composer' ) => array(
'value' => 'fadeOutDown',
'type' => 'out',
),
__( 'fadeOutDownBig', 'js_composer' ) => array(
'value' => 'fadeOutDownBig',
'type' => 'out',
),
__( 'fadeOutLeft', 'js_composer' ) => array(
'value' => 'fadeOutLeft',
'type' => 'out',
),
__( 'fadeOutLeftBig', 'js_composer' ) => array(
'value' => 'fadeOutLeftBig',
'type' => 'out',
),
__( 'fadeOutRight', 'js_composer' ) => array(
'value' => 'fadeOutRight',
'type' => 'out',
),
__( 'fadeOutRightBig', 'js_composer' ) => array(
'value' => 'fadeOutRightBig',
'type' => 'out',
),
__( 'fadeOutUp', 'js_composer' ) => array(
'value' => 'fadeOutUp',
'type' => 'out',
),
__( 'fadeOutUpBig', 'js_composer' ) => array(
'value' => 'fadeOutUpBig',
'type' => 'out',
),
),
),
array(
'label' => __( 'Flippers', 'js_composer' ),
'values' => array(
__( 'flip', 'js_composer' ) => array(
'value' => 'flip',
'type' => 'other',
),
__( 'flipInX', 'js_composer' ) => array(
'value' => 'flipInX',
'type' => 'in',
),
__( 'flipInY', 'js_composer' ) => array(
'value' => 'flipInY',
'type' => 'in',
),
__( 'flipOutX', 'js_composer' ) => array(
'value' => 'flipOutX',
'type' => 'out',
),
__( 'flipOutY', 'js_composer' ) => array(
'value' => 'flipOutY',
'type' => 'out',
),
),
),
array(
'label' => __( 'Lightspeed', 'js_composer' ),
'values' => array(
__( 'lightSpeedIn', 'js_composer' ) => array(
'value' => 'lightSpeedIn',
'type' => 'in',
),
__( 'lightSpeedOut', 'js_composer' ) => array(
'value' => 'lightSpeedOut',
'type' => 'out',
),
),
),
array(
'label' => __( 'Rotating Entrances', 'js_composer' ),
'values' => array(
__( 'rotateIn', 'js_composer' ) => array(
'value' => 'rotateIn',
'type' => 'in',
),
__( 'rotateInDownLeft', 'js_composer' ) => array(
'value' => 'rotateInDownLeft',
'type' => 'in',
),
__( 'rotateInDownRight', 'js_composer' ) => array(
'value' => 'rotateInDownRight',
'type' => 'in',
),
__( 'rotateInUpLeft', 'js_composer' ) => array(
'value' => 'rotateInUpLeft',
'type' => 'in',
),
__( 'rotateInUpRight', 'js_composer' ) => array(
'value' => 'rotateInUpRight',
'type' => 'in',
),
),
),
array(
'label' => __( 'Rotating Exits', 'js_composer' ),
'values' => array(
__( 'rotateOut', 'js_composer' ) => array(
'value' => 'rotateOut',
'type' => 'out',
),
__( 'rotateOutDownLeft', 'js_composer' ) => array(
'value' => 'rotateOutDownLeft',
'type' => 'out',
),
__( 'rotateOutDownRight', 'js_composer' ) => array(
'value' => 'rotateOutDownRight',
'type' => 'out',
),
__( 'rotateOutUpLeft', 'js_composer' ) => array(
'value' => 'rotateOutUpLeft',
'type' => 'out',
),
__( 'rotateOutUpRight', 'js_composer' ) => array(
'value' => 'rotateOutUpRight',
'type' => 'out',
),
),
),
array(
'label' => __( 'Specials', 'js_composer' ),
'values' => array(
__( 'hinge', 'js_composer' ) => array(
'value' => 'hinge',
'type' => 'out',
),
__( 'rollIn', 'js_composer' ) => array(
'value' => 'rollIn',
'type' => 'in',
),
__( 'rollOut', 'js_composer' ) => array(
'value' => 'rollOut',
'type' => 'out',
),
),
),
array(
'label' => __( 'Zoom Entrances', 'js_composer' ),
'values' => array(
__( 'zoomIn', 'js_composer' ) => array(
'value' => 'zoomIn',
'type' => 'in',
),
__( 'zoomInDown', 'js_composer' ) => array(
'value' => 'zoomInDown',
'type' => 'in',
),
__( 'zoomInLeft', 'js_composer' ) => array(
'value' => 'zoomInLeft',
'type' => 'in',
),
__( 'zoomInRight', 'js_composer' ) => array(
'value' => 'zoomInRight',
'type' => 'in',
),
__( 'zoomInUp', 'js_composer' ) => array(
'value' => 'zoomInUp',
'type' => 'in',
),
),
),
array(
'label' => __( 'Zoom Exits', 'js_composer' ),
'values' => array(
__( 'zoomOut', 'js_composer' ) => array(
'value' => 'zoomOut',
'type' => 'out',
),
__( 'zoomOutDown', 'js_composer' ) => array(
'value' => 'zoomOutDown',
'type' => 'out',
),
__( 'zoomOutLeft', 'js_composer' ) => array(
'value' => 'zoomOutLeft',
'type' => 'out',
),
__( 'zoomOutRight', 'js_composer' ) => array(
'value' => 'zoomOutRight',
'type' => 'out',
),
__( 'zoomOutUp', 'js_composer' ) => array(
'value' => 'zoomOutUp',
'type' => 'out',
),
),
),
array(
'label' => __( 'Slide Entrances', 'js_composer' ),
'values' => array(
__( 'slideInDown', 'js_composer' ) => array(
'value' => 'slideInDown',
'type' => 'in',
),
__( 'slideInLeft', 'js_composer' ) => array(
'value' => 'slideInLeft',
'type' => 'in',
),
__( 'slideInRight', 'js_composer' ) => array(
'value' => 'slideInRight',
'type' => 'in',
),
__( 'slideInUp', 'js_composer' ) => array(
'value' => 'slideInUp',
'type' => 'in',
),
),
),
array(
'label' => __( 'Slide Exits', 'js_composer' ),
'values' => array(
__( 'slideOutDown', 'js_composer' ) => array(
'value' => 'slideOutDown',
'type' => 'out',
),
__( 'slideOutLeft', 'js_composer' ) => array(
'value' => 'slideOutLeft',
'type' => 'out',
),
__( 'slideOutRight', 'js_composer' ) => array(
'value' => 'slideOutRight',
'type' => 'out',
),
__( 'slideOutUp', 'js_composer' ) => array(
'value' => 'slideOutUp',
'type' => 'out',
),
),
),
);
/**
* Used to override animation style list
* @since 4.4
*/
return apply_filters( 'vc_param_animation_style_list', $styles );
}
/**
* @param array $styles - array of styles to group
* @param string|array $type - what type to return
*
* @since 4.4
* @return array
*/
public function groupStyleByType( $styles, $type ) {
$grouped = array();
foreach ( $styles as $group ) {
$inner_group = array( 'values' => array() );
if ( isset( $group['label'] ) ) {
$inner_group['label'] = $group['label'];
}
foreach ( $group['values'] as $key => $value ) {
if ( ( is_array( $value ) && isset( $value['type'] ) && ( ( is_string( $type ) && $value['type'] == $type ) || is_array( $type ) && in_array( $value['type'], $type ) ) ) || ! is_array( $value ) || ! isset( $value['type'] ) ) {
$inner_group['values'][ $key ] = $value;
}
}
if ( ! empty( $inner_group['values'] ) ) {
$grouped[] = $inner_group;
}
}
return $grouped;
}
/**
* Set variables and register animate-css asset
* @since 4.4
*
* @param $settings
* @param $value
*/
public function __construct( $settings, $value ) {
$this->settings = $settings;
$this->value = $value;
wp_register_style( 'animate-css', vc_asset_url( 'lib/bower/animate-css/animate.min.css' ), array(), WPB_VC_VERSION );
}
/**
* Render edit form output
* @since 4.4
* @return string
*/
public function render() {
$output = '<div class="vc_row">';
wp_enqueue_style( 'animate-css' );
$styles = $this->animationStyles();
if ( isset( $this->settings['settings']['type'] ) ) {
$styles = $this->groupStyleByType( $styles, $this->settings['settings']['type'] );
}
if ( isset( $this->settings['settings']['custom'] ) && is_array( $this->settings['settings']['custom'] ) ) {
$styles = array_merge( $styles, $this->settings['settings']['custom'] );
}
if ( is_array( $styles ) && ! empty( $styles ) ) {
$left_side = '<div class="vc_col-sm-6">';
$build_style_select = "\n" . '<select class="vc_param-animation-style">' . "\n";
foreach ( $styles as $style ) {
$build_style_select .= "\t\t" . '<optgroup ' . ( isset( $style['label'] ) ? 'label="' . $style['label'] . '"' : '' ) . '>' . "\n";
if ( is_array( $style['values'] ) && ! empty( $style['values'] ) ) {
foreach ( $style['values'] as $key => $value ) {
$build_style_select .= "\t\t\t" . '<option value="' . ( is_array( $value ) ? $value['value'] : $value ) . '">' . $key . '</option>' . "\n";
}
}
$build_style_select .= "\t\t" . '</optgroup>' . "\n";
}
$build_style_select .= '</select>' . "\n";
$left_side .= $build_style_select;
$left_side .= '</div>'; // Close left_side div
$output .= $left_side;
$right_side = '<div class="vc_col-sm-6">';
$right_side .= '<div class="vc_param-animation-style-preview"><button class="vc_btn vc_btn-grey vc_btn-sm vc_param-animation-style-trigger">' . __( 'Animate it', 'js_composer' ) . '</button></div>';
$right_side .= '</div>'; // Close right_side div
$output .= $right_side;
}
$output .= '</div>'; // Close Row
$output .= '<input name="' . $this->settings['param_name'] . '" class="wpb_vc_param_value ' . $this->settings['param_name'] . ' ' . $this->settings['type'] . '_field" type="hidden" value="' . $this->value . '" ' . ' />';
return $output;
}
}
/**
* Function for rendering param in edit form (add element)
* Parse settings from vc_map and entered 'values'.
*
* @param array $settings - parameter settings in vc_map
* @param string $value - parameter value
* @param string $tag - shortcode tag
*
* vc_filter: vc_animation_style_render_filter - filter to override editor form
* field output
*
* @since 4.4
* @return mixed|void rendered template for params in edit form
*
*/
function vc_animation_style_form_field( $settings, $value, $tag ) {
$field = new Vc_ParamAnimation( $settings, $value, $tag );
/**
* Filter used to override full output of edit form field animation style
* @since 4.4
*/
return apply_filters( 'vc_animation_style_render_filter', $field->render(), $settings, $value, $tag );
}
@@ -0,0 +1,223 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_AutoComplete
* Param type 'autocomplete'
* Used to create input field with predefined or ajax values suggestions.
* See usage example in bottom of this file.
* @since 4.4
*/
class Vc_AutoComplete {
/**
* @since 4.4
* @var array $settings - param settings
*/
protected $settings;
/**
* @since 4.4
* @var string $value - current param value (if multiple it is splitted by ',' comma to make array)
*/
protected $value;
/**
* @since 4.4
* @var string $tag - shortcode name(base)
*/
protected $tag;
/**
* @param array $settings - param settings (from vc_map)
* @param string $value - current param value
* @param string $tag - shortcode name(base)
*
* @since 4.4
*/
public function __construct( $settings, $value, $tag ) {
$this->tag = $tag;
$this->settings = $settings;
$this->value = $value;
}
/**
* @since 4.4
* vc_filter: vc_autocomplete_{shortcode_tag}_{param_name}_render - hook to define output for autocomplete item
* @return string
*/
public function render() {
$output = '<div class="vc_autocomplete-field">' .
'<ul class="vc_autocomplete' .
( ( isset( $this->settings['settings'], $this->settings['settings']['display_inline'] ) && true === $this->settings['settings']['display_inline'] ) ? ' vc_autocomplete-inline' : '' ) .
'">';
if ( isset( $this->value ) && strlen( $this->value ) > 0 ) {
$values = explode( ',', $this->value );
foreach ( $values as $key => $val ) {
$value = array(
'value' => trim( $val ),
'label' => trim( $val ),
);
if ( isset( $this->settings['settings'], $this->settings['settings']['values'] ) && ! empty( $this->settings['settings']['values'] ) ) {
foreach ( $this->settings['settings']['values'] as $data ) {
if ( trim( $data['value'] ) == trim( $val ) ) {
$value['label'] = $data['label'];
break;
}
}
} else {
// Magic is here. this filter is used to render value correctly ( must return array with 'value', 'label' keys )
$value = apply_filters( 'vc_autocomplete_' . $this->tag . '_' . $this->settings['param_name'] . '_render', $value, $this->settings, $this->tag );
}
if ( is_array( $value ) && isset( $value['value'], $value['label'] ) ) {
$output .= '<li data-value="' . $value['value'] . '" data-label="' . $value['label'] . '" data-index="' . $key . '" class="vc_autocomplete-label vc_data"><span class="vc_autocomplete-label">' . $value['label'] . '</span> <a class="vc_autocomplete-remove">&times;</a></li>';
}
}
}
$output .= '<li class="vc_autocomplete-input"><span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span><input class="vc_auto_complete_param" type="text" placeholder="' . __( 'Click here and start typing...', 'js_composer' ) . '" value="' . $this->value . '" autocomplete="off"></li>' .
'<li class="vc_autocomplete-clear"></li>' .
'</ul>';
$output .= '<input name="' .
$this->settings['param_name'] .
'" class="wpb_vc_param_value ' .
$this->settings['param_name'] . ' ' .
$this->settings['type'] . '_field" type="hidden" value="' . $this->value . '" ' .
( ( isset( $this->settings['settings'] ) && ! empty( $this->settings['settings'] ) ) ? ' data-settings="' . htmlentities( json_encode( $this->settings['settings'] ), ENT_QUOTES, 'utf-8' ) . '" ' : '' ) .
' /></div>';
return $output;
}
}
/**
* @action wp_ajax_vc_get_autocomplete_suggestion - since 4.4 used to hook ajax requests for autocomplete suggestions
*/
add_action( 'wp_ajax_vc_get_autocomplete_suggestion', 'vc_get_autocomplete_suggestion' );
/**
* @since 4.4
*/
function vc_get_autocomplete_suggestion() {
vc_user_access()
->checkAdminNonce()
->validateDie()
->wpAny( 'edit_posts', 'edit_pages' )
->validateDie();
$query = vc_post_param( 'query' );
$tag = strip_tags( vc_post_param( 'shortcode' ) );
$param_name = vc_post_param( 'param' );
vc_render_suggestion( $query, $tag, $param_name );
}
/**
* @since 4.4
*
* @param $query
* @param $tag
* @param $param_name
*
* vc_filter: vc_autocomplete_{tag}_{param_name}_callback - hook to get suggestions from ajax. (here you need to hook).
*/
function vc_render_suggestion( $query, $tag, $param_name ) {
$suggestions = apply_filters( 'vc_autocomplete_' . stripslashes( $tag ) . '_' . stripslashes( $param_name ) . '_callback', $query, $tag, $param_name );
if ( is_array( $suggestions ) && ! empty( $suggestions ) ) {
die( json_encode( $suggestions ) );
}
die( '' ); // if nothing found..
}
/**
* Function for rendering param in edit form (add element)
* Parse settings from vc_map and entered values.
*
* @param $settings
* @param $value
* @param $tag
*
* @since 4.4
* vc_filter: vc_autocomplete_render_filter - hook to override output of edit for field "autocomplete"
* @return mixed|void rendered template for params in edit form
*/
function vc_autocomplete_form_field( $settings, $value, $tag ) {
$auto_complete = new Vc_AutoComplete( $settings, $value, $tag );
return apply_filters( 'vc_autocomplete_render_filter', $auto_complete->render() );
}
// Some examples
/* vc_map(
array(
'name' => __( 'Check autocomplete', 'js_composer' ),
'base' => 'vc_some_autocomplete',
'icon' => 'icon-wpb-empty_space',
'category' => __( 'New Elements', 'js_composer' ),
'description' => __( 'Something cool and best', 'js_composer' ),
'params' => array(
array(
'type' => 'autocomplete',
'heading' => __( 'Type a for example', 'js_composer' ),
'param_name' => 'ids',
'settings' => array(
'multiple' => true,
'sortable' => true,
'min_length' => 1,
'no_hide' => true, // In UI after select doesn't hide an select list
'groups' => true, // In UI show results grouped by groups
'unique_values' => true, // In UI show results except selected. NB! You should manually check values in backend
'display_inline' => true, // In UI show results inline view
'values' => array( // Using key 'values' will disable an AJAX requests on autocomplete input and also any filter for suggestions
array( 'label' => 'Abrams', 'value' => 1, 'group' => 'category' ),
array( 'label' => 'Brama', 'value' => 2, 'group' => 'category' ),
array( 'label' => 'Dron', 'value' => 3, 'group' => 'tags' ),
array( 'label' => 'Akelloam', 'value' => 4, 'group' => 'tags' ),
// Label will show when adding
// Value will saved in input
// Group only used if groups=>true, this will group data in select dropdown by groups
),
),
'description' => __( '', 'js_composer' ),
),
),
)
);
// Or with AJAX suggester:
See \js_composer\include\classes\vendors\plugins\class-vc-vendor-woocommerce.php
vc_map( array(
'name' => __( 'Product', 'js_composer' ),
'base' => 'product',
'icon' => 'icon-wpb-woocommerce',
'category' => __( 'WooCommerce', 'js_composer' ),
'description' => __( 'Show a single product by ID or SKU', 'js_composer' ),
'params' => array(
array(
'type' => 'autocomplete',
'heading' => __( 'Select identificator', 'js_composer' ),
'param_name' => 'id',
'description' => __( 'Input product ID or product SKU or product title to see suggestions', 'js_composer' ),
),
array(
'type' => 'hidden',
// This will not show on render, but will be used when defining value for autocomplete
'param_name' => 'sku',
),
)
) );
//Filters For autocomplete param:
//For suggestion: vc_autocomplete_[shortcode_name]_[param_name]_callback
add_filter( 'vc_autocomplete_product_id_callback', array(
$this,
'productIdAutocompleteSuggester'
), 10, 1 ); // Get suggestion(find). Must return an array
add_filter( 'vc_autocomplete_product_id_render', array(
$this,
'productIdAutocompleteRender'
), 10, 1 ); // Render exact item. Must return an array (label,value)
function productIdAutocompleteSuggester($query) -> should proccess your request, and return an multi-dimension associative array with keys 'label', 'value' and if necessary 'group'
function productIdAutocompleteRender($value) -> should proccess your request (for 1 exact item from "value") and return an associative array with keys 'label','value' and if necessary 'group'
*/
@@ -0,0 +1,19 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Param 'colorpicker' field
*
* @param $settings
* @param $value
*
* @since 4.4
* @return string
*/
function vc_colorpicker_form_field( $settings, $value ) {
return '<div class="color-group">'
. '<input name="' . $settings['param_name'] . '" class="wpb_vc_param_value wpb-textinput ' . $settings['param_name'] . ' ' . $settings['type'] . '_field vc_color-control" type="text" value="' . $value . '"/>'
. '</div>';
}
@@ -0,0 +1,163 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @property mixed data
*/
class Vc_Column_Offset {
/**
* @var array
*/
protected $settings = array();
/**
* @var string
*/
protected $value = '';
/**
* @var array
*/
protected $size_types = array(
'lg' => 'Large',
'md' => 'Medium',
'sm' => 'Small',
'xs' => 'Extra small',
);
/**
* @var array
*/
protected $column_width_list = array();
/**
* @param $settings
* @param $value
*/
public function __construct( $settings, $value ) {
$this->settings = $settings;
$this->value = $value;
$this->column_width_list = array(
__( '1 column - 1/12', 'js_composer' ) => '1',
__( '2 columns - 1/6', 'js_composer' ) => '2',
__( '3 columns - 1/4', 'js_composer' ) => '3',
__( '4 columns - 1/3', 'js_composer' ) => '4',
__( '5 columns - 5/12', 'js_composer' ) => '5',
__( '6 columns - 1/2', 'js_composer' ) => '6',
__( '7 columns - 7/12', 'js_composer' ) => '7',
__( '8 columns - 2/3', 'js_composer' ) => '8',
__( '9 columns - 3/4', 'js_composer' ) => '9',
__( '10 columns - 5/6', 'js_composer' ) => '10',
__( '11 columns - 11/12', 'js_composer' ) => '11',
__( '12 columns - 1/1', 'js_composer' ) => '12',
__( '20% - 1/5', 'js_composer' ) => '1/5',
__( '40% - 2/5', 'js_composer' ) => '2/5',
__( '60% - 3/5', 'js_composer' ) => '3/5',
__( '80% - 4/5', 'js_composer' ) => '4/5',
);
}
/**
* @return string
*/
public function render() {
ob_start();
vc_include_template( 'params/column_offset/template.tpl.php', array(
'settings' => $this->settings,
'value' => $this->value,
'data' => $this->valueData(),
'sizes' => $this->size_types,
'param' => $this,
) );
return ob_get_clean();
}
/**
* @return array|mixed
*/
public function valueData() {
if ( ! isset( $this->data ) ) {
$this->data = preg_split( '/\s+/', $this->value );
}
return $this->data;
}
/**
* @param $size
*
* @return string
*/
public function sizeControl( $size ) {
if ( 'sm' === $size ) {
return '<span class="vc_description">' . __( 'Default value from width attribute', 'js_composer' ) . '</span>';
}
$empty_label = 'xs' === $size ? '' : __( 'Inherit from smaller', 'js_composer' );
$output = '<select name="vc_col_' . $size . '_size" class="vc_column_offset_field" data-type="size-' . $size . '">' . '<option value="" style="color: #ccc;">' . $empty_label . '</option>';
foreach ( $this->column_width_list as $label => $index ) {
$value = 'vc_col-' . $size . '-' . $index;
$output .= '<option value="' . $value . '"' . ( in_array( $value, $this->data ) ? ' selected="true"' : '' ) . '>' . $label . '</option>';
}
$output .= '</select>';
return $output;
}
/**
* @param $size
*
* @return string
*/
public function offsetControl( $size ) {
$prefix = 'vc_col-' . $size . '-offset-';
$empty_label = 'xs' === $size ? __( 'No offset', 'js_composer' ) : __( 'Inherit from smaller', 'js_composer' );
$output = '<select name="vc_' . $size . '_offset_size" class="vc_column_offset_field" data-type="offset-' . $size . '">' . '<option value="" style="color: #ccc;">' . $empty_label . '</option>' . ( 'xs' === $size ? '' : '<option value="' . $prefix . '0" style="color: #ccc;"' . ( in_array( $prefix . '0', $this->data ) ? ' selected="true"' : '' ) . '>' . __( 'No offset', 'js_composer' ) . '</option>' );
foreach ( $this->column_width_list as $label => $index ) {
$value = $prefix . $index;
$output .= '<option value="' . $value . '"' . ( in_array( $value, $this->data ) ? ' selected="true"' : '' ) . '>' . $label . '</option>';
}
$output .= '</select>';
return $output;
}
}
/**
* @param $settings
* @param $value
*
* @return string
*/
function vc_column_offset_form_field( $settings, $value ) {
$column_offset = new Vc_Column_Offset( $settings, $value );
return $column_offset->render();
}
/**
* @param $column_offset
* @param $width
*
* @return mixed|string
*/
function vc_column_offset_class_merge( $column_offset, $width ) {
// Remove offset settings if
if ( '1' === vc_settings()->get( 'not_responsive_css' ) ) {
$column_offset = preg_replace( '/vc_col\-(lg|md|xs)[^\s]*/', '', $column_offset );
}
if ( preg_match( '/vc_col\-sm\-\d+/', $column_offset ) ) {
return $column_offset;
}
return $width . ( empty( $column_offset ) ? '' : ' ' . $column_offset );
}
/**
*
*/
function vc_load_column_offset_param() {
vc_add_shortcode_param( 'column_offset', 'vc_column_offset_form_field' );
}
add_action( 'vc_load_default_params', 'vc_load_column_offset_param' );
@@ -0,0 +1,247 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
if ( ! class_exists( 'WPBakeryVisualComposerCssEditor' ) ) {
/**
* Class WPBakeryVisualComposerCssEditor
*/
class WPBakeryVisualComposerCssEditor {
/**
* @var array
*/
protected $settings = array();
/**
* @var string
*/
protected $value = '';
/**
* @var array
*/
protected $layers = array( 'margin', 'border', 'padding', 'content' );
/**
* @var array
*/
protected $positions = array( 'top', 'right', 'bottom', 'left' );
/**
*
*/
function __construct() {
}
/**
* Setters/Getters {{
*
* @param null $settings
*
* @return array
*/
function settings( $settings = null ) {
if ( is_array( $settings ) ) {
$this->settings = $settings;
}
return $this->settings;
}
/**
* @param $key
*
* @return string
*/
function setting( $key ) {
return isset( $this->settings[ $key ] ) ? $this->settings[ $key ] : '';
}
/**
* @param null $value
*
* @return string
*/
function value( $value = null ) {
if ( is_string( $value ) ) {
$this->value = $value;
}
return $this->value;
}
/**
* @param null $values
*
* @return array
*/
function params( $values = null ) {
if ( is_array( $values ) ) {
$this->params = $values;
}
return $this->params;
}
// }}
/**
* vc_filter: vc_css_editor - hook to override output of this method
* @return mixed|void
*/
function render() {
$output = '<div class="vc_css-editor vc_row vc_ui-flex-row" data-css-editor="true">';
$output .= $this->onionLayout();
$output .= '<div class="vc_col-xs-5 vc_settings">'
. ' <label>' . __( 'Border color', 'js_composer' ) . '</label> '
. ' <div class="color-group"><input type="text" name="border_color" value="" class="vc_color-control"></div>'
. ' <label>' . __( 'Border style', 'js_composer' ) . '</label> '
. ' <div class="vc_border-style"><select name="border_style" class="vc_border-style">' . $this->getBorderStyleOptions() . '</select></div>'
. ' <label>' . __( 'Border radius', 'js_composer' ) . '</label> '
. ' <div class="vc_border-radius"><select name="border_radius" class="vc_border-radius">' . $this->getBorderRadiusOptions() . '</select></div>'
. ' <label>' . __( 'Background', 'js_composer' ) . '</label>'
. ' <div class="color-group"><input type="text" name="background_color" value="" class="vc_color-control"></div>'
. ' <div class="vc_background-image">' . $this->getBackgroundImageControl() . '<div class="vc_clearfix"></div></div>'
. ' <div class="vc_background-style"><select name="background_style" class="vc_background-style">' . $this->getBackgroundStyleOptions() . '</select></div>'
. ' <label>' . __( 'Box controls', 'js_composer' ) . '</label>'
. ' <label class="vc_checkbox"><input type="checkbox" name="simply" class="vc_simplify" value=""> ' . __( 'Simplify controls', 'js_composer' ) . '</label>'
. '</div>';
$output .= '<input name="' . $this->setting( 'param_name' ) . '" class="wpb_vc_param_value ' . $this->setting( 'param_name' ) . ' ' . $this->setting( 'type' ) . '_field" type="hidden" value="' . esc_attr( $this->value() ) . '"/>';
$output .= '</div><div class="vc_clearfix"></div>';
$output .= '<script type="text/html" id="vc_css-editor-image-block">'
. '<li class="added">'
. ' <div class="inner" style="width: 80px; height: 80px; overflow: hidden;text-align: center;">'
. ' <img src="{{ img.url }}?id={{ img.id }}" data-image-id="{{ img.id }}" class="vc_ce-image<# if (!_.isUndefined(img.css_class)) {#> {{ img.css_class }}<# }#>">'
. ' </div>'
. ' <a href="#" class="vc_icon-remove"><i class="vc-composer-icon vc-c-icon-close"></i></a>'
. '</li>'
. '</script>';
return apply_filters( 'vc_css_editor', $output );
}
/**
* @return string
*/
function getBackgroundImageControl() {
return apply_filters( 'vc_css_editor_background_image_control', '<ul class="vc_image">'
. '</ul>'
. '<a href="#" class="vc_add-image"><i class="vc-composer-icon vc-c-icon-add"></i>' . __( 'Add image', 'js_composer' ) . '</a>' );
}
/**
* @return string
*/
function getBorderRadiusOptions() {
$radiuses = apply_filters( 'vc_css_editor_border_radius_options_data', array(
'' => __( 'None', 'js_composer' ),
'1px' => '1px',
'2px' => '2px',
'3px' => '3px',
'4px' => '4px',
'5px' => '5px',
'10px' => '10px',
'15px' => '15px',
'20px' => '20px',
'25px' => '25px',
'30px' => '30px',
'35px' => '35px',
) );
$output = '';
foreach ( $radiuses as $radius => $title ) {
$output .= '<option value="' . $radius . '">' . $title . '</option>';
}
return $output;
}
/**
* @return string
*/
function getBorderStyleOptions() {
$output = '<option value="">' . __( 'Theme defaults', 'js_composer' ) . '</option>';
$styles = apply_filters( 'vc_css_editor_border_style_options_data', array(
'solid',
'dotted',
'dashed',
'none',
'hidden',
'double',
'groove',
'ridge',
'inset',
'outset',
'initial',
'inherit',
) );
foreach ( $styles as $style ) {
$output .= '<option value="' . $style . '">' . __( ucfirst( $style ), 'js_composer' ) . '</option>';
}
return $output;
}
/**
* @return string
*/
function getBackgroundStyleOptions() {
$output = '<option value="">' . __( 'Theme defaults', 'js_composer' ) . '</option>';
$styles = apply_filters( 'vc_css_editor_background_style_options_data', array(
__( 'Cover', 'js_composer' ) => 'cover',
__( 'Contain', 'js_composer' ) => 'contain',
__( 'No Repeat', 'js_composer' ) => 'no-repeat',
__( 'Repeat', 'js_composer' ) => 'repeat',
) );
foreach ( $styles as $name => $style ) {
$output .= '<option value="' . $style . '">' . $name . '</option>';
}
return $output;
}
/**
* @return string
*/
function onionLayout() {
$output = '<div class="vc_layout-onion vc_col-xs-7">'
. ' <div class="vc_margin">' . $this->layerControls( 'margin' )
. ' <div class="vc_border">' . $this->layerControls( 'border', 'width' )
. ' <div class="vc_padding">' . $this->layerControls( 'padding' )
. ' <div class="vc_content"><i></i></div>'
. ' </div>'
. ' </div>'
. ' </div>'
. '</div>';
return apply_filters( 'vc_css_editor_onion_layout', $output );
}
/**
* @param $name
* @param string $prefix
*
* @return string
*/
protected function layerControls( $name, $prefix = '' ) {
$output = '<label>' . $name . '</label>';
foreach ( $this->positions as $pos ) {
$output .= '<input type="text" name="' . $name . '_' . $pos . ( '' !== $prefix ? '_' . $prefix : '' ) . '" data-name="' . $name . ( '' !== $prefix ? '-' . $prefix : '' ) . '-' . $pos . '" class="vc_' . $pos . '" placeholder="-" data-attribute="' . $name . '" value="">';
}
return apply_filters( 'vc_css_editor_layer_controls', $output );
}
}
}
/**
* @param $settings
* @param $value
*
* @return mixed|void
*/
function vc_css_editor_form_field( $settings, $value ) {
$css_editor = new WPBakeryVisualComposerCssEditor();
$css_editor->settings( $settings );
$css_editor->value( $value );
return $css_editor->render();
}
@@ -0,0 +1,33 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Function for rendering param in edit form (add element)
* Parse settings from vc_map and entered values.
* @since 4.4
*
* @param $settings
* @param $value
* @param $tag
*
* vc_filter: vc_custom_markup_render_filter - hook to override custom markup for field
*
* @return mixed|void rendered template for params in edit form
*
*/
function vc_custom_markup_form_field( $settings, $value, $tag ) {
return apply_filters( 'vc_custom_markup_render_filter', $value, $settings, $tag );
}
// Example
/*
array(
'param_name' => 'hidden_markup1', // all params must have a unique name
'type' => 'custom_markup', // this param type
'description' => __( 'Enter your content..', 'js_composer' ), // some description if needed
'value' => '<div style="background:red;width:100%;height:40px">aaa</div>', // your custom markup
),
*/
@@ -0,0 +1,361 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder shortcode default attributes functions for rendering.
*
* @package WPBakeryPageBuilder
* @since 4.4
*/
/**
* Textfield shortcode attribute type generator.
*
* @param $settings
* @param $value
*
* @since 4.4
* @return string - html string.
*/
function vc_textfield_form_field( $settings, $value ) {
$value = htmlspecialchars( $value );
return '<input name="' . $settings['param_name']
. '" class="wpb_vc_param_value wpb-textinput '
. $settings['param_name'] . ' ' . $settings['type']
. '" type="text" value="' . $value . '"/>';
}
/**
* Dropdown(select with options) shortcode attribute type generator.
*
* @param $settings
* @param $value
*
* @since 4.4
* @return string - html string.
*/
function vc_dropdown_form_field( $settings, $value ) {
$output = '';
$css_option = str_replace( '#', 'hash-', vc_get_dropdown_option( $settings, $value ) );
$output .= '<select name="'
. $settings['param_name']
. '" class="wpb_vc_param_value wpb-input wpb-select '
. $settings['param_name']
. ' ' . $settings['type']
. ' ' . $css_option
. '" data-option="' . $css_option . '">';
if ( is_array( $value ) ) {
$value = isset( $value['value'] ) ? $value['value'] : array_shift( $value );
}
if ( ! empty( $settings['value'] ) ) {
foreach ( $settings['value'] as $index => $data ) {
if ( is_numeric( $index ) && ( is_string( $data ) || is_numeric( $data ) ) ) {
$option_label = $data;
$option_value = $data;
} elseif ( is_numeric( $index ) && is_array( $data ) ) {
$option_label = isset( $data['label'] ) ? $data['label'] : array_pop( $data );
$option_value = isset( $data['value'] ) ? $data['value'] : array_pop( $data );
} else {
$option_value = $data;
$option_label = $index;
}
$selected = '';
$option_value_string = (string) $option_value;
$value_string = (string) $value;
if ( '' !== $value && $option_value_string === $value_string ) {
$selected = ' selected="selected"';
}
$option_class = str_replace( '#', 'hash-', $option_value );
$output .= '<option class="' . esc_attr( $option_class ) . '" value="' . esc_attr( $option_value ) . '"' . $selected . '>'
. htmlspecialchars( $option_label ) . '</option>';
}
}
$output .= '</select>';
return $output;
}
/**
* Checkbox shortcode attribute type generator.
*
* @param $settings
* @param string $value
*
* @since 4.4
* @return string - html string.
*/
function vc_checkbox_form_field( $settings, $value ) {
$output = '';
if ( is_array( $value ) ) {
$value = ''; // fix #1239
}
$current_value = strlen( $value ) > 0 ? explode( ',', $value ) : array();
$values = isset( $settings['value'] ) && is_array( $settings['value'] ) ? $settings['value'] : array( __( 'Yes' ) => 'true' );
if ( ! empty( $values ) ) {
foreach ( $values as $label => $v ) {
$checked = count( $current_value ) > 0 && in_array( $v, $current_value ) ? ' checked' : '';
$output .= ' <label class="vc_checkbox-label"><input id="'
. $settings['param_name'] . '-' . $v . '" value="'
. $v . '" class="wpb_vc_param_value '
. $settings['param_name'] . ' ' . $settings['type'] . '" type="checkbox" name="'
. $settings['param_name'] . '"'
. $checked . '> ' . $label . '</label>';
}
}
return $output;
}
add_filter( 'vc_map_get_param_defaults', 'vc_checkbox_param_defaults', 10, 2 );
function vc_checkbox_param_defaults( $value, $param ) {
if ( 'checkbox' === $param['type'] ) {
$value = '';
if ( isset( $param['std'] ) ) {
$value = $param['std'];
}
}
return $value;
}
/**
* Checkbox shortcode attribute type generator.
*
* @param $settings
* @param $value
*
* @since 4.4
* @return string - html string.
*/
function vc_posttypes_form_field( $settings, $value ) {
$output = '';
$args = array(
'public' => true,
);
$post_types = get_post_types( $args );
foreach ( $post_types as $post_type ) {
$checked = '';
if ( 'attachment' !== $post_type ) {
if ( in_array( $post_type, explode( ',', $value ) ) ) {
$checked = ' checked="checked"';
}
$output .= ' <label class="vc_checkbox-label"><input id="'
. $settings['param_name'] . '-' . $post_type . '" value="'
. $post_type . '" class="wpb_vc_param_value '
. $settings['param_name']
. ' ' . $settings['type']
. '" type="checkbox" name="'
. $settings['param_name'] . '"' . $checked . '> '
. $post_type . '</label>';
}
}
return $output;
}
/**
* Taxonomies shortcode attribute type generator.
*
* @param $settings
* @param $value
*
* @since 4.4
* @return string - html string.
*/
function vc_taxonomies_form_field( $settings, $value ) {
$output = '';
$post_types = get_post_types( array( 'public' => false, 'name' => 'attachment' ), 'names', 'NOT' );
foreach ( $post_types as $type ) {
$taxonomies = get_object_taxonomies( $type, '' );
foreach ( $taxonomies as $tax ) {
$checked = '';
if ( in_array( $tax->name, explode( ',', $value ) ) ) {
$checked = ' checked';
}
$output .= ' <label class="vc_checkbox-label" data-post-type="'
. $type . '"><input id="'
. $settings['param_name'] . '-' . $tax->name
. '" value="' . $tax->name
. '" data-post-type="' . $type
. '" class="wpb_vc_param_value '
. $settings['param_name']
. ' ' . $settings['type']
. '" type="checkbox" name="' . $settings['param_name'] . '"' . $checked . '> '
. $tax->label . '</label>';
}
}
return $output;
}
/**
* Exploded textarea shortcode attribute type generator.
*
* Data saved and coma-separated values are merged with line breaks and returned in a textarea.
*
* @param $settings
* @param $value
*
* @since 4.4
* @return string - html string.
*/
function vc_exploded_textarea_form_field( $settings, $value ) {
$value = str_replace( ',', "\n", $value );
return '<textarea name="'
. $settings['param_name'] . '" class="wpb_vc_param_value wpb-textarea '
. $settings['param_name'] . ' ' . $settings['type'] . '">' . $value . '</textarea>';
}
/**
* Safe Textarea shortcode attribute type generator.
*
* @param $settings
* @param $value
*
* @since 4.8.2
* @return string - html string.
*/
function vc_exploded_textarea_safe_form_field( $settings, $value ) {
$value = vc_value_from_safe( $value, true );
$value = str_replace( ',', "\n", $value );
return '<textarea name="'
. $settings['param_name'] . '" class="wpb_vc_param_value wpb-textarea '
. $settings['param_name'] . ' ' . $settings['type'] . '">'
. $value . '</textarea>';
}
/**
* Textarea raw html shortcode attribute type generator.
*
* This attribute type allows safely add custom html to your post/page.
*
* @param $settings
* @param $value
*
* @since 4.4
* @return string - html string.
*/
function vc_textarea_raw_html_form_field( $settings, $value ) {
return '<textarea name="'
. $settings['param_name'] . '" class="wpb_vc_param_value wpb-textarea_raw_html '
. $settings['param_name'] . ' ' . $settings['type'] . '" rows="16">'
. htmlentities( rawurldecode( base64_decode( $value ) ), ENT_COMPAT, 'UTF-8' ) . '</textarea>';
}
/**
* Safe Textarea shortcode attribute type generator.
*
* @param $settings
* @param $value
*
* @since 4.4
* @return string - html string.
*/
function vc_textarea_safe_form_field( $settings, $value ) {
return '<textarea name="'
. $settings['param_name'] . '" class="wpb_vc_param_value wpb-textarea_raw_html '
. $settings['param_name'] . ' ' . $settings['type'] . '">'
. vc_value_from_safe( $value, true ) . '</textarea>';
}
/**
* Textarea shortcode attribute type generator.
*
* @param $settings
* @param $value
*
* @since 4.4
* @return string - html string.
*/
function vc_textarea_form_field( $settings, $value ) {
return '<textarea name="' .
$settings['param_name'] . '" class="wpb_vc_param_value wpb-textarea '
. $settings['param_name'] . ' ' . $settings['type'] . '">' . $value . '</textarea>';
}
/**
* Attach images shortcode attribute type generator.
*
* @param $settings
* @param $value
*
* @since 4.4
*
* @param $tag
* @param bool $single
*
* @return string - html string.
*/
function vc_attach_images_form_field( $settings, $value, $tag, $single = false ) {
$output = '';
$param_value = wpb_removeNotExistingImgIDs( $value );
$output .= '<input type="hidden" class="wpb_vc_param_value gallery_widget_attached_images_ids '
. $settings['param_name'] . ' '
. $settings['type'] . '" name="' . $settings['param_name'] . '" value="' . $value . '"/>';
$output .= '<div class="gallery_widget_attached_images">';
$output .= '<ul class="gallery_widget_attached_images_list">';
$output .= ( '' !== $param_value ) ? fieldAttachedImages( explode( ',', $value ) ) : '';
$output .= '</ul>';
$output .= '</div>';
$output .= '<div class="gallery_widget_site_images">';
$output .= '</div>';
if ( true === $single ) {
$output .= '<a class="gallery_widget_add_images" href="#" use-single="true" title="'
. __( 'Add image', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-add"></i>' . __( 'Add image', 'js_composer' ) . '</a>'; //class: button
} else {
$output .= '<a class="gallery_widget_add_images" href="#" title="'
. __( 'Add images', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-add"></i>' . __( 'Add images', 'js_composer' ) . '</a>'; //class: button
}
return $output;
}
/**
* Attach image shortcode attribute type generator.
*
* @param $settings
* @param $value
*
* @param $tag
*
* @since 4.4
* @return string - html string.
*/
function vc_attach_image_form_field( $settings, $value, $tag ) {
return vc_attach_images_form_field( $settings, $value, $tag, true );
}
/**
* Widgetised sidebars shortcode attribute type generator.
*
* @param $settings
* @param $value
*
* @since 4.4
* @return string - html string.
*/
function vc_widgetised_sidebars_form_field( $settings, $value ) {
$output = '';
$sidebars = $GLOBALS['wp_registered_sidebars'];
$output .= '<select name="' . $settings['param_name']
. '" class="wpb_vc_param_value dropdown wpb-input wpb-select '
. $settings['param_name'] . ' '
. $settings['type'] . '">';
foreach ( $sidebars as $sidebar ) {
$selected = '';
if ( $sidebar['id'] == $value ) {
$selected = ' selected';
}
$sidebar_name = $sidebar['name'];
$output .= '<option value="' . $sidebar['id'] . '"' . $selected . '>' . $sidebar_name . '</option>';
}
$output .= '</select>';
return $output;
}
@@ -0,0 +1,21 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @param $settings
* @param $value
*
* @since 4.5
* @return string
*/
function vc_el_id_form_field( $settings, $value ) {
return apply_filters( 'vc_el_id_render_filter', '<div class="vc-param-el_id">'
. '<input name="' . $settings['param_name']
. '" class="wpb_vc_param_value wpb-textinput '
. $settings['param_name'] . ' ' . $settings['type'] . '_field" type="text" value="'
. $value . '" />'
. '</div>' );
}
@@ -0,0 +1,294 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_Font_Container
* @since 4.3
* vc_map examples:
* array(
* 'type' => 'font_container',
* 'param_name' => 'font_container',
* 'value'=>'',
* 'settings'=>array(
* 'fields'=>array(
* 'tag'=>'h2',
* 'text_align',
* 'font_size',
* 'line_height',
* 'color',
*
* 'tag_description' => __('Select element tag.','js_composer'),
* 'text_align_description' => __('Select text alignment.','js_composer'),
* 'font_size_description' => __('Enter font size.','js_composer'),
* 'line_height_description' => __('Enter line height.','js_composer'),
* 'color_description' => __('Select color for your element.','js_composer'),
* ),
* ),
* ),
* Ordering of fields, font_family, tag, text_align and etc. will be Same as ordering in array!
* To provide default value to field use 'key' => 'value'
*/
class Vc_Font_Container {
/**
* @param $settings
* @param $value
*
* @return string
*/
public function render( $settings, $value ) {
$fields = array();
$values = array();
extract( $this->_vc_font_container_parse_attributes( $settings['settings']['fields'], $value ) );
$data = array();
$output = '';
if ( ! empty( $fields ) ) {
if ( isset( $fields['tag'] ) ) {
$data['tag'] = '
<div class="vc_row-fluid vc_column">
<div class="wpb_element_label">' . __( 'Element tag', 'js_composer' ) . '</div>
<div class="vc_font_container_form_field-tag-container">
<select class="vc_font_container_form_field-tag-select">';
$tags = $this->_vc_font_container_get_allowed_tags();
foreach ( $tags as $tag ) {
$data['tag'] .= '<option value="' . $tag . '" class="' . $tag . '" ' . ( $values['tag'] == $tag ? 'selected' : '' ) . '>' . $tag . '</option>';
}
$data['tag'] .= '
</select>
</div>';
if ( isset( $fields['tag_description'] ) && strlen( $fields['tag_description'] ) > 0 ) {
$data['tag'] .= '
<span class="vc_description clear">' . $fields['tag_description'] . '</span>
';
}
$data['tag'] .= '</div>';
}
if ( isset( $fields['font_size'] ) ) {
$data['font_size'] = '
<div class="vc_row-fluid vc_column">
<div class="wpb_element_label">' . __( 'Font size', 'js_composer' ) . '</div>
<div class="vc_font_container_form_field-font_size-container">
<input class="vc_font_container_form_field-font_size-input" type="text" value="' . $values['font_size'] . '" />
</div>';
if ( isset( $fields['font_size_description'] ) && strlen( $fields['font_size_description'] ) > 0 ) {
$data['font_size'] .= '
<span class="vc_description clear">' . $fields['font_size_description'] . '</span>
';
}
$data['font_size'] .= '</div>';
}
if ( isset( $fields['text_align'] ) ) {
$data['text_align'] = '
<div class="vc_row-fluid vc_column">
<div class="wpb_element_label">' . __( 'Text align', 'js_composer' ) . '</div>
<div class="vc_font_container_form_field-text_align-container">
<select class="vc_font_container_form_field-text_align-select">
<option value="left" class="left" ' . ( 'left' === $values['text_align'] ? 'selected="selected"' : '' ) . '>' . __( 'left', 'js_composer' ) . '</option>
<option value="right" class="right" ' . ( 'right' === $values['text_align'] ? 'selected="selected"' : '' ) . '>' . __( 'right', 'js_composer' ) . '</option>
<option value="center" class="center" ' . ( 'center' === $values['text_align'] ? 'selected="selected"' : '' ) . '>' . __( 'center', 'js_composer' ) . '</option>
<option value="justify" class="justify" ' . ( 'justify' === $values['text_align'] ? 'selected="selected"' : '' ) . '>' . __( 'justify', 'js_composer' ) . '</option>
</select>
</div>';
if ( isset( $fields['text_align_description'] ) && strlen( $fields['text_align_description'] ) > 0 ) {
$data['text_align'] .= '
<span class="vc_description clear">' . $fields['text_align_description'] . '</span>
';
}
$data['text_align'] .= '</div>';
}
if ( isset( $fields['line_height'] ) ) {
$data['line_height'] = '
<div class="vc_row-fluid vc_column">
<div class="wpb_element_label">' . __( 'Line height', 'js_composer' ) . '</div>
<div class="vc_font_container_form_field-line_height-container">
<input class="vc_font_container_form_field-line_height-input" type="text" value="' . $values['line_height'] . '" />
</div>';
if ( isset( $fields['line_height_description'] ) && strlen( $fields['line_height_description'] ) > 0 ) {
$data['line_height'] .= '
<span class="vc_description clear">' . $fields['line_height_description'] . '</span>
';
}
$data['line_height'] .= '</div>';
}
if ( isset( $fields['color'] ) ) {
$data['color'] = '
<div class="vc_row-fluid vc_column">
<div class="wpb_element_label">' . __( 'Text color', 'js_composer' ) . '</div>
<div class="vc_font_container_form_field-color-container">
<div class="color-group">
<input type="text" value="' . $values['color'] . '" class="vc_font_container_form_field-color-input vc_color-control" />
</div>
</div>';
if ( isset( $fields['color_description'] ) && strlen( $fields['color_description'] ) > 0 ) {
$data['color'] .= '
<span class="vc_description clear">' . $fields['color_description'] . '</span>
';
}
$data['color'] .= '</div>';
}
if ( isset( $fields['font_family'] ) ) {
$data['font_family'] = '
<div class="vc_row-fluid vc_column">
<div class="wpb_element_label">' . __( 'Font Family', 'js_composer' ) . '</div>
<div class="vc_font_container_form_field-font_family-container">
<select class="vc_font_container_form_field-font_family-select">';
$fonts = $this->_vc_font_container_get_web_safe_fonts();
foreach ( $fonts as $font_name => $font_data ) {
$data['font_family'] .= '<option value="' . $font_name . '" class="' . vc_build_safe_css_class( $font_name ) . '" ' . ( strtolower( $values['font_family'] ) == strtolower( $font_name ) ? 'selected' : '' ) . ' data[font_family]="' . urlencode( $font_data ) . '">' . $font_name . '</option>';
}
$data['font_family'] .= '
</select>
</div>';
if ( isset( $fields['font_family_description'] ) && strlen( $fields['font_family_description'] ) > 0 ) {
$data['font_family'] .= '
<span class="vc_description clear">' . $fields['font_family_description'] . '</span>
';
}
$data['font_family'] .= '</div>';
}
if ( isset( $fields['font_style'] ) ) {
$data['font_style'] = '
<div class="vc_row-fluid vc_column">
<div class="wpb_element_label">' . __( 'Font style', 'js_composer' ) . '</div>
<div class="vc_font_container_form_field-font_style-container">
<label>
<input type="checkbox" class="vc_font_container_form_field-font_style-checkbox italic" value="italic" ' . ( '1' === $values['font_style_italic'] ? 'checked' : '' ) . '><span class="vc_font_container_form_field-font_style-label italic">' . __( 'italic', 'js_composer' ) . '</span>
</label>
<br />
<label>
<input type="checkbox" class="vc_font_container_form_field-font_style-checkbox bold" value="bold" ' . ( '1' === $values['font_style_bold'] ? 'checked' : '' ) . '><span class="vc_font_container_form_field-font_style-label bold">' . __( 'bold', 'js_composer' ) . '</span>
</label>
</div>';
if ( isset( $fields['font_style_description'] ) && strlen( $fields['font_style_description'] ) > 0 ) {
$data['font_style'] .= '
<span class="vc_description clear">' . $fields['font_style_description'] . '</span>
';
}
$data['font_style'] .= '</div>';
}
$data = apply_filters( 'vc_font_container_output_data', $data, $fields, $values, $settings );
// combine all in output, make sure you follow ordering
foreach ( $fields as $key => $field ) {
if ( isset( $data[ $key ] ) ) {
$output .= $data[ $key ];
}
}
}
$output .= '<input name="' . $settings['param_name'] . '" class="wpb_vc_param_value ' . $settings['param_name'] . ' ' . $settings['type'] . '_field" type="hidden" value="' . $value . '" />';
return $output;
}
/**
* If field 'font_family' is used this is list of fonts available
* To modify this list, you should use add_filter('vc_font_container_get_fonts_filter','your_custom_function');
* vc_filter: vc_font_container_get_fonts_filter - to modify list of fonts
* @return array list of fonts
*/
public function _vc_font_container_get_web_safe_fonts() {
// this is "Web Safe FONTS" from w3c: http://www.w3schools.com/cssref/css_websafe_fonts.asp
$web_fonts = array(
'Georgia' => 'Georgia, serif',
'Palatino Linotype' => '"Palatino Linotype", "Book Antiqua", Palatino, serif',
'Book Antiqua' => '"Book Antiqua", Palatino, serif',
'Palatino' => 'Palatino, serif',
'Times New Roman' => '"Times New Roman", Times, serif',
'Arial' => 'Arial, Helvetica, sans-serif',
'Arial Black' => '"Arial Black", Gadget, sans-serif',
'Helvetica' => 'Helvetica, sans-serif',
'Comic Sans MS' => '"Comic Sans MS", cursive, sans-serif',
'Impact' => 'Impact, Charcoal, sans-serif',
'Charcoal' => 'Charcoal, sans-serif',
'Lucida Sans Unicode' => '"Lucida Sans Unicode", "Lucida Grande", sans-serif',
'Lucida Grande' => '"Lucida Grande", sans-serif',
'Tahoma' => 'Tahoma, Geneva, sans-serif',
'Geneva' => 'Geneva, sans-serif',
'Trebuchet MS' => '"Trebuchet MS", Helvetica, sans-serif',
'Verdana' => '"Trebuchet MS", Helvetica, sans-serif',
'Courier New' => '"Courier New", Courier, monospace',
'Lucida Console' => '"Lucida Console", Monaco, monospace',
'Monaco' => 'Monaco, monospace',
);
return apply_filters( 'vc_font_container_get_fonts_filter', $web_fonts );
}
/**
* If 'tag' field used this is list of allowed tags
* To modify this list, you should use add_filter('vc_font_container_get_allowed_tags','your_custom_function');
* vc_filter: vc_font_container_get_allowed_tags - to modify list of allowed tags by default
* @return array list of allowed tags
*/
public function _vc_font_container_get_allowed_tags() {
$allowed_tags = array(
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'p',
'div',
);
return apply_filters( 'vc_font_container_get_allowed_tags', $allowed_tags );
}
/**
* @param $attr
* @param $value
*
* @return array
*/
public function _vc_font_container_parse_attributes( $attr, $value ) {
$fields = array();
if ( isset( $attr ) ) {
foreach ( $attr as $key => $val ) {
if ( is_numeric( $key ) ) {
$fields[ $val ] = '';
} else {
$fields[ $key ] = $val;
}
}
}
$values = vc_parse_multi_attribute( $value, array(
'tag' => isset( $fields['tag'] ) ? $fields['tag'] : 'h2',
'font_size' => isset( $fields['font_size'] ) ? $fields['font_size'] : '',
'font_style_italic' => isset( $fields['font_style_italic'] ) ? $fields['font_style_italic'] : '',
'font_style_bold' => isset( $fields['font_style_bold'] ) ? $fields['font_style_bold'] : '',
'font_family' => isset( $fields['font_family'] ) ? $fields['font_family'] : '',
'color' => isset( $fields['color'] ) ? $fields['color'] : '',
'line_height' => isset( $fields['line_height'] ) ? $fields['line_height'] : '',
'text_align' => isset( $fields['text_align'] ) ? $fields['text_align'] : 'left',
'tag_description' => isset( $fields['tag_description'] ) ? $fields['tag_description'] : '',
'font_size_description' => isset( $fields['font_size_description'] ) ? $fields['font_size_description'] : '',
'font_style_description' => isset( $fields['font_style_description'] ) ? $fields['font_style_description'] : '',
'font_family_description' => isset( $fields['font_family_description'] ) ? $fields['font_family_description'] : '',
'color_description' => isset( $fields['color_description'] ) ? $fields['color_description'] : 'left',
'line_height_description' => isset( $fields['line_height_description'] ) ? $fields['line_height_description'] : '',
'text_align_description' => isset( $fields['text_align_description'] ) ? $fields['text_align_description'] : '',
)
);
return array( 'fields' => $fields, 'values' => $values );
}
}
/**
* @param $settings
* @param $value
*
* @return mixed|void
*/
function vc_font_container_form_field( $settings, $value ) {
$font_container = new Vc_Font_Container();
return apply_filters( 'vc_font_container_render_filter', $font_container->render( $settings, $value ) );
}
@@ -0,0 +1,114 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_Google_Fonts
* @since 4.3
* vc_map examples:
* 'params' => array(
* array(
* 'type' => 'google_fonts',
* 'param_name' => 'google_fonts',
* 'value' => '',// Not recommended, this will override 'settings'. Example:
* 'font_family:'.rawurlencode('Exo:100,100italic,200,200italic,300,300italic,regular,italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic').'|font_style:'.rawurlencode('900
* bold italic:900:italic'),
* 'settings' => array(
* 'fields'=>array(
* 'font_family'=>'Abril Fatface:regular',//
* 'Exo:100,100italic,200,200italic,300,300italic,regular,italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic',
* Default font family and all available styles to fetch
* 'font_style'=>'400 regular:400:normal', // Default font style. Name:weight:style, example:
* "800 bold regular:800:normal"
* 'font_family_description' => __('Select font family.','js_composer'),
* 'font_style_description' => __('Select font styling.','js_composer')
* )
* ),
* 'description' => __( 'Description for this group', 'js_composer' ), // Description for field group
* ),
* )
*/
class Vc_Google_Fonts {
public $fonts_list = '[{"font_family":"Abril Fatface","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"ABeeZee","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"Abel","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Aclonica","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Acme","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Actor","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Adamina","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Advent Pro","font_styles":"100,200,300,regular,500,600,700","font_types":"100 light regular:100:normal,200 light regular:200:normal,300 light regular:300:normal,400 regular:400:normal,500 bold regular:500:normal,600 bold regular:600:normal,700 bold regular:700:normal"},{"font_family":"Aguafina Script","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Akronim","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Aladin","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Aldrich","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Alef","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Alegreya","font_styles":"regular,italic,700,700italic,900,900italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic,900 bold regular:900:normal,900 bold italic:900:italic"},{"font_family":"Alegreya SC","font_styles":"regular,italic,700,700italic,900,900italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic,900 bold regular:900:normal,900 bold italic:900:italic"},{"font_family":"Alegreya Sans","font_styles":"100,100italic,300,300italic,regular,italic,500,500italic,700,700italic,800,800italic,900,900italic","font_types":"100 light regular:100:normal,100 light italic:100:italic,300 light regular:300:normal,300 light italic:300:italic,400 regular:400:normal,400 italic:400:italic,500 bold regular:500:normal,500 bold italic:500:italic,700 bold regular:700:normal,700 bold italic:700:italic,800 bold regular:800:normal,800 bold italic:800:italic,900 bold regular:900:normal,900 bold italic:900:italic"},{"font_family":"Alegreya Sans SC","font_styles":"100,100italic,300,300italic,regular,italic,500,500italic,700,700italic,800,800italic,900,900italic","font_types":"100 light regular:100:normal,100 light italic:100:italic,300 light regular:300:normal,300 light italic:300:italic,400 regular:400:normal,400 italic:400:italic,500 bold regular:500:normal,500 bold italic:500:italic,700 bold regular:700:normal,700 bold italic:700:italic,800 bold regular:800:normal,800 bold italic:800:italic,900 bold regular:900:normal,900 bold italic:900:italic"},{"font_family":"Alex Brush","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Alfa Slab One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Alice","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Alike","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Alike Angular","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Allan","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Allerta","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Allerta Stencil","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Allura","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Almendra","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Almendra Display","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Almendra SC","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Amarante","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Amaranth","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Amatic SC","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Amethysta","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Anaheim","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Andada","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Andika","font_styles":"regular","font_types":"400 regular:400:normal"},{"f Line truncated
/**
* @param $settings
* @param $value
*
* @since 4.3
* @return string
*/
public function render( $settings, $value ) {
$fields = array();
$values = array();
$set = isset( $settings['settings'], $settings['settings']['fields'] ) ? $settings['settings']['fields'] : array();
extract( $this->_vc_google_fonts_parse_attributes( $set, $value ) );
ob_start();
include vc_path_dir( 'TEMPLATES_DIR', 'params/google_fonts/template.php' );
return ob_get_clean();
}
/**
*
* Load google fonts list for param
* To change this list use add_filters('vc_google_fonts_get_fonts_filter','your_custom_function'); and change array
* vc_filter: vc_google_fonts_get_fonts_filter
* @since 4.3
* @return array List of available fonts as array of objects. {"font_family":"Abril
* Fatface","font_styles":"regular","font_types":"400 regular:400:normal"}
*
* @return array
*/
public function _vc_google_fonts_get_fonts() {
return apply_filters( 'vc_google_fonts_get_fonts_filter', json_decode( $this->fonts_list ) );
}
/**
* @param $attr
* @param $value
*
* @since 4.3
* @return array
*/
public function _vc_google_fonts_parse_attributes( $attr, $value ) {
$fields = array();
if ( is_array( $attr ) && ! empty( $attr ) ) {
foreach ( $attr as $key => $val ) {
if ( is_numeric( $key ) ) {
$fields[ $val ] = '';
} else {
$fields[ $key ] = $val;
}
}
}
$values = vc_parse_multi_attribute( $value, array(
'font_family' => isset( $fields['font_family'] ) ? $fields['font_family'] : '',
'font_style' => isset( $fields['font_style'] ) ? $fields['font_style'] : '',
'font_family_description' => isset( $fields['font_family_description'] ) ? $fields['font_family_description'] : '',
'font_style_description' => isset( $fields['font_style_description'] ) ? $fields['font_style_description'] : '',
) );
return array( 'fields' => $fields, 'values' => $values );
}
}
/**
* Function for rendering param in edit form (add element)
* Parse settings from vc_map and entered values.
*
* @param $settings
* @param $value
*
* @since 4.3
* vc_filter: vc_google_fonts_render_filter
* @return mixed|void rendered template for params in edit form
*
*/
function vc_google_fonts_form_field( $settings, $value ) {
$google_fonts = new Vc_Google_Fonts();
return apply_filters( 'vc_google_fonts_render_filter', $google_fonts->render( $settings, $value ) );
}
@@ -0,0 +1,113 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
header( 'Status: 403 Forbidden' );
header( 'HTTP/1.1 403 Forbidden' );
exit;
}
class Gutenberg_Param {
protected $postTypeSlug = 'wpb_gutenberg_param';
public function __construct() {
add_action( 'init', array(
$this,
'initialize',
) );
}
public function initialize() {
global $pagenow, $wp_version;
if ( version_compare( $wp_version, '4.9.8', '>' ) && 'post-new.php' === $pagenow && vc_user_access()->wpAll( 'edit_posts' )
->get() && vc_request_param( 'post_type' ) === $this->postTypeSlug ) {
$this->registerGutenbergAttributeType();
add_action( 'admin_print_styles', array(
$this,
'removeAdminUI',
) );
}
}
public function removeAdminUi() {
$style = '
<style>
#adminmenumain, #wpadminbar {
display: none;
}
html.wp-toolbar {
padding: 0 !important;
}
.wp-toolbar #wpcontent {
margin: 0;
}
.wp-toolbar #wpbody {
padding-top: 0;
}
.gutenberg .gutenberg__editor .edit-post-layout .edit-post-header, html .block-editor-page .edit-post-header {
top: 0;
left: 0;
}
.gutenberg .gutenberg__editor .edit-post-layout.is-sidebar-opened .edit-post-layout__content, html .block-editor-page .edit-post-layout.is-sidebar-opened .edit-post-layout__content {
margin-right: 0;
}
.gutenberg .gutenberg__editor .edit-post-layout .editor-post-publish-panel, html .block-editor-page .edit-post-layout .editor-post-publish-panel, html .block-editor-page .edit-post-header__settings {
display: none;
}
.editor-post-title {
display: none !important;
}
</style>
';
echo $style;
}
protected function registerGutenbergAttributeType() {
$labels = array(
'name' => _x( 'Gutenberg attrs', 'Post type general name', 'js_composer' ),
'singular_name' => _x( 'Gutenberg attr', 'Post type singular name', 'js_composer' ),
'menu_name' => _x( 'Gutenberg attrs', 'Admin Menu text', 'js_composer' ),
'name_admin_bar' => _x( 'Gutenberg attr', 'Add New on Toolbar', 'js_composer' ),
'add_new' => __( 'Add New', 'js_composer' ),
'add_new_item' => __( 'Add New Gutenberg attr', 'js_composer' ),
'new_item' => __( 'New Gutenberg attr', 'js_composer' ),
'edit_item' => __( 'Edit Gutenberg attr', 'js_composer' ),
'view_item' => __( 'View Gutenberg attr', 'js_composer' ),
'all_items' => __( 'All Gutenberg attrs', 'js_composer' ),
'search_items' => __( 'Search Gutenberg attrs', 'js_composer' ),
'parent_item_colon' => __( 'Parent Gutenberg attrs:', 'js_composer' ),
'not_found' => __( 'No Gutenberg attrs found.', 'js_composer' ),
'not_found_in_trash' => __( 'No Gutenberg attrs found in Trash.', 'js_composer' ),
'featured_image' => _x( 'Gutenberg attr Cover Image', 'Overrides the “Featured Image” phrase for this post type. Added in 4.3', 'js_composer' ),
'set_featured_image' => _x( 'Set cover image', 'Overrides the “Set featured image” phrase for this post type. Added in 4.3', 'js_composer' ),
'remove_featured_image' => _x( 'Remove cover image', 'Overrides the “Remove featured image” phrase for this post type. Added in 4.3', 'js_composer' ),
'use_featured_image' => _x( 'Use as cover image', 'Overrides the “Use as featured image” phrase for this post type. Added in 4.3', 'js_composer' ),
'archives' => _x( 'Gutenberg attr archives', 'The post type archive label used in nav menus. Default “Post Archives”. Added in 4.4', 'js_composer' ),
'insert_into_item' => _x( 'Add into Gutenberg attr', 'Overrides the “Insert into post”/”Insert into page” phrase (used when inserting media into a post). Added in 4.4', 'js_composer' ),
'uploaded_to_this_item' => _x( 'Uploaded to this Gutenberg attr', 'Overrides the “Uploaded to this post”/”Uploaded to this page” phrase (used when viewing media attached to a post). Added in 4.4', 'js_composer' ),
'filter_items_list' => _x( 'Filter Gutenberg attrs list', 'Screen reader text for the filter links heading on the post type listing screen. Default “Filter posts list”/”Filter pages list”. Added in 4.4', 'js_composer' ),
'items_list_navigation' => _x( 'Gutenberg attrs list navigation', 'Screen reader text for the pagination heading on the post type listing screen. Default “Posts list navigation”/”Pages list navigation”. Added in 4.4', 'js_composer' ),
'items_list' => _x( 'Gutenberg attrs list', 'Screen reader text for the items list heading on the post type listing screen. Default “Posts list”/”Pages list”. Added in 4.4', 'js_composer' ),
);
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => false,
'query_var' => false,
'capability_type' => 'page',
'has_archive' => false,
'hierarchical' => false,
'menu_position' => null,
'show_in_rest' => true,
'supports' => array( 'editor' ),
);
register_post_type( $this->postTypeSlug, $args );
}
}
@@ -0,0 +1,18 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Gutenberg field param.
*
* @param $settings
* @param $value
*
* @return string - html string.
*/
function vc_gutenberg_form_field( $settings, $value ) {
$value = htmlspecialchars( $value );
return '<div class="vc_gutenberg-field-wrapper"><button class="vc_btn vc_btn-grey vc_btn-sm" data-vc-action="open">Open Editor</button><div class="vc_gutenberg-modal-wrapper"></div><input name="' . $settings['param_name'] . '" class="wpb_vc_param_value vc_gutenberg-field vc_param-name-' . $settings['param_name'] . ' ' . $settings['type'] . '" type="hidden" value="' . $value . '"/></div>';
}
@@ -0,0 +1,45 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Hidden field param.
*
* @param $settings
* @param $value
*
* @since 4.5
* @return string - html string.
*/
function vc_hidden_form_field( $settings, $value ) {
$value = htmlspecialchars( $value );
return '<input name="' . $settings['param_name'] . '" class="wpb_vc_param_value vc_hidden-field vc_param-name-' . $settings['param_name'] . ' ' . $settings['type'] . '" type="hidden" value="' . $value . '"/>';
}
/**
* Remove content before hidden field type input.
*
* @param $output
*
* @since 4.5
*
* @return string
*/
function vc_edit_form_fields_render_field_hidden_before( $output ) {
return '<div class="vc_column vc_edit-form-hidden-field-wrapper">';
}
/**
* Remove content after hidden field type input.
*
* @param $output
*
* @since 4.5
*
* @return string
*/
function vc_edit_form_fields_render_field_hidden_after( $output ) {
return '</div>';
}
@@ -0,0 +1,21 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @param $settings
* @param $value
*
* @since 4.4
* @return string
*/
function vc_href_form_field( $settings, $value ) {
if ( ! is_string( $value ) || strlen( $value ) === 0 ) {
$value = 'http://';
}
return '<div class="vc_href-form-field">'
. '<input name="' . $settings['param_name'] . '" class="wpb_vc_param_value wpb-textinput ' . $settings['param_name'] . ' ' . $settings['type'] . '_field" type="text" value="' . $value . '"/>'
. '</div>';
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,75 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder shortcode attributes fields loader
*
* @package WPBakeryPageBuilder
*
*/
require_once vc_path_dir( 'PARAMS_DIR', '/default_params.php' );
/**
* Loads attributes hooks.
*/
require_once vc_path_dir( 'PARAMS_DIR', '/textarea_html/textarea_html.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/colorpicker/colorpicker.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/loop/loop.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/vc_link/vc_link.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/options/options.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/sorted_list/sorted_list.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/css_editor/css_editor.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/tab_id/tab_id.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/href/href.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/font_container/font_container.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/google_fonts/google_fonts.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/column_offset/column_offset.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/autocomplete/autocomplete.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/params_preset/params_preset.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/param_group/param_group.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/custom_markup/custom_markup.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/animation_style/animation_style.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/iconpicker/iconpicker.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/el_id/el_id.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/gutenberg/gutenberg.php' );
global $vc_params_list;
$vc_params_list = array(
// Default
'textfield',
'dropdown',
'textarea_html',
'checkbox',
'posttypes',
'taxonomies',
'taxomonies',
'exploded_textarea',
'exploded_textarea_safe',
'textarea_raw_html',
'textarea_safe',
'textarea',
'attach_images',
'attach_image',
'widgetised_sidebars',
// Advanced
'colorpicker',
'loop',
'vc_link',
'options',
'sorted_list',
'css_editor',
'font_container',
'google_fonts',
'autocomplete',
'tab_id',
'href',
'params_preset',
'param_group',
'custom_markup',
'animation_style',
'iconpicker',
'el_id',
'gutenberg',
);
@@ -0,0 +1,927 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @param $settings
* @param $value
*
* @since 4.2
* @return string
*/
function vc_loop_form_field( $settings, $value ) {
$query_builder = new VcLoopSettings( $value );
$params = $query_builder->getContent();
$loop_info = '';
if ( is_array( $params ) ) {
foreach ( $params as $key => $param ) {
$param_value = vc_loop_get_value( $param );
if ( ! empty( $param_value ) ) {
$loop_info .= ' <b>' . $query_builder->getLabel( $key ) . '</b>: ' . $param_value . ';';
}
}
}
return '<div class="vc_loop">'
. '<input name="' . $settings['param_name'] . '" class="wpb_vc_param_value ' . $settings['param_name'] . ' ' . $settings['type'] . '_field" type="hidden" value="' . $value . '"/>'
. '<a href="#" class="button vc_loop-build ' . $settings['param_name'] . '_button" data-settings="' . rawurlencode( json_encode( $settings['settings'] ) ) . '">' . __( 'Build query', 'js_composer' ) . '</a>'
. '<div class="vc_loop-info">' . $loop_info . '</div>'
. '</div>';
}
/**
* @param $param
*
* @since 4.2
* @return string
*/
function vc_loop_get_value( $param ) {
$value = array();
$selected_values = (array) $param['value'];
if ( isset( $param['options'] ) && is_array( $param['options'] ) ) {
foreach ( $param['options'] as $option ) {
if ( is_array( $option ) && isset( $option['value'] ) ) {
if ( in_array( ( ( '-' === $option['action'] ? '-' : '' ) . $option['value'] ), $selected_values ) ) {
$value[] = $option['action'] . $option['name'];
}
} elseif ( is_array( $option ) && isset( $option[0] ) ) {
if ( in_array( $option[0], $selected_values ) ) {
$value[] = $option[1];
}
} elseif ( in_array( $option, $selected_values ) ) {
$value[] = $option;
}
}
} else {
$value[] = $param['value'];
}
return implode( ', ', $value );
}
/**
* Parses loop settings and creates WP_Query according to manual
* @since 4.2
* @link http://codex.wordpress.org/Class_Reference/WP_Query
*/
class VcLoopQueryBuilder {
/**
* @since 4.2
* @var array
*/
protected $args = array(
'post_status' => 'publish', // show only published posts #1098
);
/**
* @since 4.2
*
* @param $data
*/
function __construct( $data ) {
foreach ( $data as $key => $value ) {
$method = 'parse_' . $key;
if ( method_exists( $this, $method ) ) {
$this->$method( $value );
}
}
}
/**
* Pages count
* @since 4.2
*
* @param $value
*/
protected function parse_size( $value ) {
$this->args['posts_per_page'] = 'All' === $value ? - 1 : (int) $value;
}
/**
* Sorting field
* @since 4.2
*
* @param $value
*/
protected function parse_order_by( $value ) {
$this->args['orderby'] = $value;
}
/**
* Sorting order
* @since 4.2
*
* @param $value
*/
protected function parse_order( $value ) {
$this->args['order'] = $value;
}
/**
* By post types
* @since 4.2
*
* @param $value
*/
protected function parse_post_type( $value ) {
$this->args['post_type'] = $this->stringToArray( $value );
}
/**
* By author
* @since 4.2
*
* @param $value
*/
protected function parse_authors( $value ) {
$this->args['author'] = $value;
}
/**
* By categories
* @since 4.2
*
* @param $value
*/
protected function parse_categories( $value ) {
$this->args['cat'] = $value;
}
/**
* By taxonomies
* @since 4.2
*
* @param $value
*/
protected function parse_tax_query( $value ) {
$terms = $this->stringToArray( $value );
if ( empty( $this->args['tax_query'] ) ) {
$this->args['tax_query'] = array( 'relation' => 'AND' );
}
$negative_term_list = array();
foreach ( $terms as $term ) {
if ( (int) $term < 0 ) {
$negative_term_list[] = abs( $term );
}
}
$not_in = array();
$in = array();
$terms = get_terms( VcLoopSettings::getTaxonomies(),
array( 'include' => array_map( 'abs', $terms ) ) );
foreach ( $terms as $t ) {
if ( in_array( (int) $t->term_id, $negative_term_list ) ) {
$not_in[ $t->taxonomy ][] = $t->term_id;
} else {
$in[ $t->taxonomy ][] = $t->term_id;
}
}
foreach ( $in as $taxonomy => $terms ) {
$this->args['tax_query'][] = array(
'field' => 'term_id',
'taxonomy' => $taxonomy,
'terms' => $terms,
'operator' => 'IN',
);
}
foreach ( $not_in as $taxonomy => $terms ) {
$this->args['tax_query'][] = array(
'field' => 'term_id',
'taxonomy' => $taxonomy,
'terms' => $terms,
'operator' => 'NOT IN',
);
}
}
/**
* By tags ids
* @since 4.2
*
* @param $value
*/
protected function parse_tags( $value ) {
$in = $not_in = array();
$tags_ids = $this->stringToArray( $value );
foreach ( $tags_ids as $tag ) {
$tag = (int) $tag;
if ( $tag < 0 ) {
$not_in[] = abs( $tag );
} else {
$in[] = $tag;
}
}
$this->args['tag__in'] = $in;
$this->args['tag__not_in'] = $not_in;
}
/**
* By posts ids
* @since 4.2
*
* @param $value
*/
protected function parse_by_id( $value ) {
$in = $not_in = array();
$ids = $this->stringToArray( $value );
foreach ( $ids as $id ) {
$id = (int) $id;
if ( $id < 0 ) {
$not_in[] = abs( $id );
} else {
$in[] = $id;
}
}
$this->args['post__in'] = $in;
$this->args['post__not_in'] = $not_in;
}
/**
* @since 4.2
*
* @param $id
*/
public function excludeId( $id ) {
if ( ! isset( $this->args['post__not_in'] ) ) {
$this->args['post__not_in'] = array();
}
if ( is_array( $id ) ) {
$this->args['post__not_in'] = array_merge( $this->args['post__not_in'], $id );
} else {
$this->args['post__not_in'][] = $id;
}
}
/**
* Converts string to array. Filters empty arrays values
* @since 4.2
*
* @param $value
*
* @return array
*/
protected function stringToArray( $value ) {
$valid_values = array();
$list = preg_split( '/\,[\s]*/', $value );
foreach ( $list as $v ) {
if ( strlen( $v ) > 0 ) {
$valid_values[] = $v;
}
}
return $valid_values;
}
/**
* @return array
*/
public function build() {
return array( $this->args, new WP_Query( $this->args ) );
}
}
/**
* Class VcLoopSettings
* @since 4.2
*/
class VcLoopSettings {
// Available parts of loop for WP_Query object.
/**
* @since 4.2
* @var array
*/
protected $content = array();
/**
* @since 4.2
* @var array
*/
protected $parts;
/**
* @since 4.2
* @var array
*/
protected $query_parts = array(
'size',
'order_by',
'order',
'post_type',
'authors',
'categories',
'tags',
'tax_query',
'by_id',
);
/**
* @since 4.2
*
* @param $value
* @param array $settings
*/
function __construct( $value, $settings = array() ) {
$this->parts = array(
'size' => __( 'Post count', 'js_composer' ),
'order_by' => __( 'Order by', 'js_composer' ),
'order' => __( 'Sort order', 'js_composer' ),
'post_type' => __( 'Post types', 'js_composer' ),
'authors' => __( 'Author', 'js_composer' ),
'categories' => __( 'Categories', 'js_composer' ),
'tags' => __( 'Tags', 'js_composer' ),
'tax_query' => __( 'Taxonomies', 'js_composer' ),
'by_id' => __( 'Individual posts/pages', 'js_composer' ),
);
$this->settings = $settings;
// Parse loop string
$data = $this->parseData( $value );
foreach ( $this->query_parts as $part ) {
$value = isset( $data[ $part ] ) ? $data[ $part ] : '';
$locked = 'true' === $this->getSettings( $part, 'locked' );
// Predefined value check.
if ( ! is_null( $this->getSettings( $part, 'value' ) ) && $this->replaceLockedValue( $part )
&& ( true === $locked || 0 === strlen( (string) $value ) )
) {
$value = $this->settings[ $part ]['value'];
} elseif ( ! is_null( $this->getSettings( $part, 'value' ) ) && ! $this->replaceLockedValue( $part )
&& ( true === $locked || 0 === strlen( (string) $value ) )
) {
$value = implode( ',', array_unique( explode( ',', $value . ',' . $this->settings[ $part ]['value'] ) ) );
}
// Find custom method for parsing
if ( method_exists( $this, 'parse_' . $part ) ) {
$method = 'parse_' . $part;
$this->content[ $part ] = $this->$method( $value );
} else {
$this->content[ $part ] = $this->parseString( $value );
}
// Set locked if value is locked by settings
if ( $locked ) {
$this->content[ $part ]['locked'] = true;
}
//
if ( 'true' === $this->getSettings( $part, 'hidden' ) ) {
$this->content[ $part ]['hidden'] = true;
}
}
}
/**
* @param $part
*
* @since 4.2
* @return bool
*/
protected function replaceLockedValue( $part ) {
return in_array( $part, array( 'size', 'order_by', 'order' ) );
}
/**
* @param $key
*
* @since 4.2
* @return mixed
*/
public function getLabel( $key ) {
return isset( $this->parts[ $key ] ) ? $this->parts[ $key ] : $key;
}
/**
* @param $part
* @param $name
*
* @since 4.2
* @return null
*/
public function getSettings( $part, $name ) {
$settings_exists = isset( $this->settings[ $part ] ) && is_array( $this->settings[ $part ] );
return $settings_exists && isset( $this->settings[ $part ][ $name ] ) ? $this->settings[ $part ][ $name ] : null;
}
/**
* @param $value
*
* @since 4.2
* @return array
*/
public function parseString( $value ) {
return array( 'value' => $value );
}
/**
* @param $value
* @param array $options
*
* @since 4.2
* @return array
*/
protected function parseDropDown( $value, $options = array() ) {
return array( 'value' => $value, 'options' => $options );
}
/**
* @param $value
* @param array $options
*
* @since 4.2
* @return array
*/
protected function parseMultiSelect( $value, $options = array() ) {
return array( 'value' => explode( ',', $value ), 'options' => $options );
}
/**
* @param $value
*
* @since 4.2
* @return array
*/
public function parse_order_by( $value ) {
return $this->parseDropDown( $value, array(
array( 'date', __( 'Date', 'js_composer' ) ),
'ID',
array( 'author', __( 'Author', 'js_composer' ) ),
array( 'title', __( 'Title', 'js_composer' ) ),
array( 'modified', __( 'Modified', 'js_composer' ) ),
array( 'rand', __( 'Random', 'js_composer' ) ),
array( 'comment_count', __( 'Comment count', 'js_composer' ) ),
array( 'menu_order', __( 'Menu order', 'js_composer' ) ),
) );
}
/**
* @param $value
*
* @since 4.2
* @return array
*/
public function parse_order( $value ) {
return $this->parseDropDown( $value, array(
array( 'ASC', __( 'Ascending', 'js_composer' ) ),
array( 'DESC', __( 'Descending', 'js_composer' ) ),
) );
}
/**
* @param $value
*
* @since 4.2
* @return array
*/
public function parse_post_type( $value ) {
$options = array();
$args = array(
'public' => true,
);
$post_types = get_post_types( $args );
foreach ( $post_types as $post_type ) {
if ( 'attachment' !== $post_type ) {
$options[] = $post_type;
}
}
return $this->parseMultiSelect( $value, $options );
}
/**
* @param $value
*
* @since 4.2
* @return array
*/
public function parse_authors( $value ) {
$options = $not_in = array();
if ( empty( $value ) ) {
return $this->parseMultiSelect( $value, $options );
}
$list = explode( ',', $value );
foreach ( $list as $id ) {
if ( (int) $id < 0 ) {
$not_in[] = abs( $id );
}
}
$users = get_users( array( 'include' => array_map( 'abs', $list ) ) );
foreach ( $users as $user ) {
$options[] = array(
'value' => (string) $user->ID,
'name' => $user->data->user_nicename,
'action' => in_array( (int) $user->ID, $not_in ) ? '-' : '+',
);
}
return $this->parseMultiSelect( $value, $options );
}
/**
* @param $value
*
* @since 4.2
* @return array
*/
public function parse_categories( $value ) {
$options = $not_in = array();
if ( empty( $value ) ) {
return $this->parseMultiSelect( $value, $options );
}
$list = explode( ',', $value );
foreach ( $list as $id ) {
if ( (int) $id < 0 ) {
$not_in[] = abs( $id );
}
}
$list = get_categories( array( 'include' => array_map( 'abs', $list ) ) );
foreach ( $list as $obj ) {
$options[] = array(
'value' => (string) $obj->cat_ID,
'name' => $obj->cat_name,
'action' => in_array( (int) $obj->cat_ID, $not_in ) ? '-' : '+',
);
}
return $this->parseMultiSelect( $value, $options );
}
/**
* @param $value
*
* @since 4.2
* @return array
*/
public function parse_tags( $value ) {
$options = $not_in = array();
if ( empty( $value ) ) {
return $this->parseMultiSelect( $value, $options );
}
$list = explode( ',', $value );
foreach ( $list as $id ) {
if ( (int) $id < 0 ) {
$not_in[] = abs( $id );
}
}
$list = get_tags( array( 'include' => array_map( 'abs', $list ) ) );
foreach ( $list as $obj ) {
$options[] = array(
'value' => (string) $obj->term_id,
'name' => $obj->name,
'action' => in_array( (int) $obj->term_id, $not_in ) ? '-' : '+',
);
}
return $this->parseMultiSelect( $value, $options );
}
/**
* @param $value
*
* @since 4.2
* @return array
*/
public function parse_tax_query( $value ) {
$options = $not_in = array();
if ( empty( $value ) ) {
return $this->parseMultiSelect( $value, $options );
}
$list = explode( ',', $value );
foreach ( $list as $id ) {
if ( (int) $id < 0 ) {
$not_in[] = abs( $id );
}
}
$list = get_terms( self::getTaxonomies(), array( 'include' => array_map( 'abs', $list ) ) );
foreach ( $list as $obj ) {
$options[] = array(
'value' => (string) $obj->term_id,
'name' => $obj->name,
'action' => in_array( (int) $obj->term_id, $not_in ) ? '-' : '+',
);
}
return $this->parseMultiSelect( $value, $options );
}
/**
* @param $value
*
* @since 4.2
* @return array
*/
public function parse_by_id( $value ) {
$options = $not_in = array();
if ( empty( $value ) ) {
return $this->parseMultiSelect( $value, $options );
}
$list = explode( ',', $value );
foreach ( $list as $id ) {
if ( (int) $id < 0 ) {
$not_in[] = abs( $id );
}
}
$list = get_posts( array( 'post_type' => 'any', 'include' => array_map( 'abs', $list ) ) );
foreach ( $list as $obj ) {
$options[] = array(
'value' => (string) $obj->ID,
'name' => $obj->post_title,
'action' => in_array( (int) $obj->ID, $not_in ) ? '-' : '+',
);
}
return $this->parseMultiSelect( $value, $options );
}
/**
* @since 4.2
*/
public function render() {
echo json_encode( $this->content );
}
/**
* @since 4.2
* @return array
*/
public function getContent() {
return $this->content;
}
/**
* get list of taxonomies which has no tags and categories items.
* @since 4.2
* @static
* @return array
*/
public static function getTaxonomies() {
$taxonomy_exclude = (array) apply_filters( 'get_categories_taxonomy', 'category' );
$taxonomy_exclude[] = 'post_tag';
$taxonomies = array();
foreach ( get_taxonomies() as $taxonomy ) {
if ( ! in_array( $taxonomy, $taxonomy_exclude ) ) {
$taxonomies[] = $taxonomy;
}
}
return $taxonomies;
}
/**
* @param $settings
*
* @since 4.2
* @return string
*/
public static function buildDefault( $settings ) {
if ( ! isset( $settings['settings'] ) || ! is_array( $settings['settings'] ) ) {
return '';
}
$value = '';
foreach ( $settings['settings'] as $key => $val ) {
if ( isset( $val['value'] ) ) {
$value .= ( empty( $value ) ? '' : '|' ) . $key . ':' . $val['value'];
}
}
return $value;
}
/**
* @param $query
* @param bool $exclude_id
*
* @since 4.2
* @return array
*/
public static function buildWpQuery( $query, $exclude_id = false ) {
$data = self::parseData( $query );
$query_builder = new VcLoopQueryBuilder( $data );
if ( $exclude_id ) {
$query_builder->excludeId( $exclude_id );
}
return $query_builder->build();
}
/**
* @param $value
*
* @since 4.2
* @return array
*/
public static function parseData( $value ) {
$data = array();
$values_pairs = preg_split( '/\|/', $value );
foreach ( $values_pairs as $pair ) {
if ( ! empty( $pair ) ) {
list( $key, $value ) = preg_split( '/\:/', $pair );
$data[ $key ] = $value;
}
}
return $data;
}
}
/**
* Suggestion list for wp_query field
* Class VcLoopSuggestions
* @since 4.2
*/
class VcLoopSuggestions {
/**
* @since 4.2
* @var array
*/
protected $content = array();
/**
* @since 4.2
* @var array
*/
protected $exclude = array();
/**
* @since 4.2
* @var
*/
protected $field;
/**
* @param $field
* @param $query
* @param $exclude
*
* @since 4.2
*/
function __construct( $field, $query, $exclude ) {
$this->exclude = explode( ',', $exclude );
$method_name = 'get_' . preg_replace( '/_out$/', '', $field );
if ( method_exists( $this, $method_name ) ) {
$this->$method_name( $query );
}
}
/**
* @param $query
*
* @since 4.2
*/
public function get_authors( $query ) {
$args = ! empty( $query ) ? array(
'search' => '*' . $query . '*',
'search_columns' => array( 'user_nicename' ),
) : array();
if ( ! empty( $this->exclude ) ) {
$args['exclude'] = $this->exclude;
}
$users = get_users( $args );
foreach ( $users as $user ) {
$this->content[] = array( 'value' => (string) $user->ID, 'name' => (string) $user->data->user_nicename );
}
}
/**
* @param $query
*
* @since 4.2
*/
public function get_categories( $query ) {
$args = ! empty( $query ) ? array( 'search' => $query ) : array();
if ( ! empty( $this->exclude ) ) {
$args['exclude'] = $this->exclude;
}
$categories = get_categories( $args );
foreach ( $categories as $cat ) {
$this->content[] = array( 'value' => (string) $cat->cat_ID, 'name' => $cat->cat_name );
}
}
/**
* @param $query
*
* @since 4.2
*/
public function get_tags( $query ) {
$args = ! empty( $query ) ? array( 'search' => $query ) : array();
if ( ! empty( $this->exclude ) ) {
$args['exclude'] = $this->exclude;
}
$tags = get_tags( $args );
foreach ( $tags as $tag ) {
$this->content[] = array( 'value' => (string) $tag->term_id, 'name' => $tag->name );
}
}
/**
* @param $query
*
* @since 4.2
*/
public function get_tax_query( $query ) {
$args = ! empty( $query ) ? array( 'search' => $query ) : array();
if ( ! empty( $this->exclude ) ) {
$args['exclude'] = $this->exclude;
}
$tags = get_terms( VcLoopSettings::getTaxonomies(), $args );
foreach ( $tags as $tag ) {
$this->content[] = array(
'value' => $tag->term_id,
'name' => $tag->name . ' (' . $tag->taxonomy . ')',
);
}
}
/**
* @param $query
*
* @since 4.2
*/
public function get_by_id( $query ) {
$args = ! empty( $query ) ? array( 's' => $query, 'post_type' => 'any' ) : array( 'post_type' => 'any' );
if ( ! empty( $this->exclude ) ) {
$args['exclude'] = $this->exclude;
}
$posts = get_posts( $args );
foreach ( $posts as $post ) {
$this->content[] = array( 'value' => $post->ID, 'name' => $post->post_title );
}
}
/**
* @since 4.2
*/
public function render() {
echo json_encode( $this->content );
}
}
/**
* Build WP_Query object from query string.
* String created by loop controllers
*
* @param $query
* @param bool $exclude_id
*
* @since 4.2
* @return string
*/
function vc_build_loop_query( $query, $exclude_id = false ) {
return VcLoopSettings::buildWpQuery( $query, $exclude_id );
}
/**
* @since 4.2
*/
function vc_get_loop_suggestion() {
vc_user_access()
->checkAdminNonce()
->validateDie()
->wpAny( 'edit_posts', 'edit_pages' )
->validateDie();
$loop_suggestions = new VcLoopSuggestions( vc_post_param( 'field' ), vc_post_param( 'query' ), vc_post_param( 'exclude' ) );
$loop_suggestions->render();
die();
}
/**
* @since 4.2
*/
function vc_get_loop_settings_json() {
vc_user_access()
->checkAdminNonce()
->validateDie()
->wpAny( 'edit_posts', 'edit_pages' )
->validateDie();
$loop_settings = new VcLoopSettings( vc_post_param( 'value' ), vc_post_param( 'settings' ) );
$loop_settings->render();
die();
}
add_action( 'wp_ajax_wpb_get_loop_suggestion', 'vc_get_loop_suggestion' );
add_action( 'wp_ajax_wpb_get_loop_settings', 'vc_get_loop_settings_json' );
/**
* @since 4.2
*/
function vc_loop_include_templates() {
require_once vc_path_dir( 'TEMPLATES_DIR', 'params/loop/templates.html' );
}
add_action( 'admin_footer', 'vc_loop_include_templates' );
/**
* @param $param
*
* @since 4.2
* @return mixed
*/
function vc_set_loop_default_value( $param ) {
if ( empty( $param['value'] ) && isset( $param['settings'] ) ) {
$param['value'] = VcLoopSettings::buildDefault( $param );
}
return $param;
}
add_filter( 'vc_mapper_attribute_loop', 'vc_set_loop_default_value' );
@@ -0,0 +1,27 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @param $settings
* @param $value
*
* @since 4.2
* @return string
*/
function vc_options_form_field( $settings, $value ) {
return '<div class="vc_options">'
. '<input name="' . $settings['param_name'] . '" class="wpb_vc_param_value ' . $settings['param_name'] . ' ' . $settings['type'] . '_field" type="hidden" value="' . $value . '"/>'
. '<a href="#" class="button vc_options-edit ' . $settings['param_name'] . '_button">' . __( 'Manage options', 'js_composer' ) . '</a>'
. '</div><div class="vc_options-fields" data-settings="' . htmlspecialchars( json_encode( $settings['options'] ) ) . '"><a href="#" class="button vc_close-button">' . __( 'Close', 'js_composer' ) . '</a></div>';
}
/**
* @since 4.2
*/
function vc_options_include_templates() {
require_once vc_path_dir( 'TEMPLATES_DIR', 'params/options/templates.html' );
}
add_action( 'admin_footer', 'vc_options_include_templates' );
@@ -0,0 +1,253 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'EDITORS_DIR', 'class-vc-edit-form-fields.php' );
/**
* Class Vc_ParamGroup_Edit_Form_Fields
* @since 4.4
*/
class Vc_ParamGroup_Edit_Form_Fields extends Vc_Edit_Form_Fields {
/**
* @since 4.4
*
* @param $settings
*/
public function __construct( $settings ) {
$this->setSettings( $settings );
}
/**
* @param $param
* @param $value
*
* @since 4.4
* @return mixed|void
*/
public function renderField( $param, $value ) {
return parent::renderField( $param, $value );
}
/**
* Get shortcode attribute value wrapper for params group.
*
* This function checks if value isn't set then it uses std or value fields in param settings.
* @since 5.2.1
*
* @param $params_settings
* @param null $value
*
* @return mixed;
*/
public function getParamGroupAttributeValue( $params_settings, $value = null ) {
return $this->parseShortcodeAttributeValue( $params_settings, $value );
}
}
/**
* Class Vc_ParamGroup
* @since 4.4
*/
class Vc_ParamGroup {
/**
* @since 4.4
* @var
*/
protected $settings;
/**
* @since 4.4
* @var array|mixed
*/
protected $value;
/**
* @since 4.4
* @var
*/
protected $map;
/**
* @since 4.4
* @var
*/
protected $atts;
/**
* @param $settings
* @param $value
* @param $tag
*
* @since 4.4
*/
public function __construct( $settings, $value, $tag ) {
$this->settings = $settings;
$this->settings['base'] = $tag;
$this->value = vc_param_group_parse_atts( $value );
$this->unparsed_value = $value;
}
/**
* @param $param_name
* @param $arr
*
* @since 4.4
* @return array
*/
public function params_to_arr( $param_name, $arr ) {
$data = array();
foreach ( $arr as $param ) {
$data[ $param_name . '_' . $param['param_name'] ] = $param['type'];
}
return $data;
}
/**
* @since 4.4
* @return mixed|string
*/
public function render() {
$output = '';
$edit_form = new Vc_ParamGroup_Edit_Form_Fields( $this->settings );
$settings = $this->settings;
$output .= '<ul class="vc_param_group-list vc_settings" data-settings="' . htmlentities( json_encode( $settings ), ENT_QUOTES, 'utf-8' ) . '">';
$template = vc_include_template( 'params/param_group/content.tpl.php' );
// Parsing values
if ( ! empty( $this->value ) ) {
foreach ( $this->value as $values ) {
$output .= $template;
$value_block = "<div class='vc_param_group-wrapper vc_clearfix'>";
$data = $values;
foreach ( $this->settings['params'] as $param ) {
$param_value = isset( $data[ $param['param_name'] ] ) ? $data[ $param['param_name'] ] : ( isset( $param['value'] ) ? $param['value'] : null );
$param['param_name'] = $this->settings['param_name'] . '_' . $param['param_name'];
$value = $edit_form->getParamGroupAttributeValue( $param, $param_value );
$value_block .= $edit_form->renderField( $param, $value );
}
$value_block .= '</div>';
$output = str_replace( '%content%', $value_block, $output );
}
} else {
$output .= $template;
}
// Empty fields wrapper and Add new fields wrapper
$content = "<div class='vc_param_group-wrapper vc_clearfix'>";
foreach ( $this->settings['params'] as $param ) {
$param['param_name'] = $this->settings['param_name'] . '_' . $param['param_name'];
$value = $edit_form->getParamGroupAttributeValue( $param );
$content .= $edit_form->renderField( $param, $value );
}
$content .= '</div>';
$output = str_replace( '%content%', $content, $output );
// And button on bottom
$output .= '<li class="wpb_column_container vc_container_for_children vc_param_group-add_content vc_empty-container"></li></ul>';
$add_template = vc_include_template( 'params/param_group/add.tpl.php' );
$add_template = str_replace( '%content%', $content, $add_template );
$output .= '<script type="text/html" class="vc_param_group-template">' . json_encode( $add_template ) . '</script>';
$output .= '<input name="' . $this->settings['param_name'] . '" class="wpb_vc_param_value ' . $this->settings['param_name'] . ' ' . $this->settings['type'] . '_field" type="hidden" value="' . $this->unparsed_value . '" />';
return $output;
}
}
/**
* Function for rendering param in edit form (add element)
* Parse settings from vc_map and entered values.
*
* @param $param_settings
* @param $param_value
* @param $tag
*
* @since 4.4
*
* vc_filter: vc_param_group_render_filter
*
* @return mixed|void rendered template for params in edit form
*/
function vc_param_group_form_field( $param_settings, $param_value, $tag ) {
$param_group = new Vc_ParamGroup( $param_settings, $param_value, $tag );
return apply_filters( 'vc_param_group_render_filter', $param_group->render() );
}
add_action( 'wp_ajax_vc_param_group_clone', 'vc_param_group_clone' );
/**
* @since 4.4
*/
function vc_param_group_clone() {
vc_user_access()
->checkAdminNonce()
->validateDie()
->wpAny( 'edit_posts', 'edit_pages' )
->validateDie();
$param = vc_post_param( 'param' );
$value = vc_post_param( 'value' );
$tag = vc_post_param( 'shortcode' );
die( vc_param_group_clone_by_data( $tag, json_decode( urldecode( $param ), true ), json_decode( urldecode( $value ), true ) ) );
}
/**
* @param $tag
* @param $params
* @param $data
*
* @since 4.4
* @return mixed|string
*/
function vc_param_group_clone_by_data( $tag, $params, $data ) {
$output = '';
$params['base'] = $tag;
$edit_form = new Vc_ParamGroup_Edit_Form_Fields( $params );
$edit_form->loadDefaultParams();
$template = vc_include_template( 'params/param_group/content.tpl.php' );
$output .= $template;
$value_block = "<div class='vc_param_group-wrapper vc_clearfix'>";
$data = $data[0];
if ( isset( $params['params'] ) && is_array( $params['params'] ) ) {
foreach ( $params['params'] as $param ) {
$param_data = isset( $data[ $param['param_name'] ] ) ? $data[ $param['param_name'] ] : ( isset( $param['value'] ) ? $param['value'] : '' );
$param['param_name'] = $params['param_name'] . '_' . $param['param_name'];
$value_block .= $edit_form->renderField( $param, $param_data );
}
}
$value_block .= '</div>';
$output = str_replace( '%content%', $value_block, $output );
return $output;
}
/**
* @param $atts_string
*
* @since 4.4
* @return array|mixed
*/
function vc_param_group_parse_atts( $atts_string ) {
$array = json_decode( urldecode( $atts_string ), true );
return $array;
}
add_filter( 'vc_map_get_param_defaults', 'vc_param_group_param_defaults', 10, 2 );
function vc_param_group_param_defaults( $value, $param ) {
if ( 'param_group' === $param['type'] && isset( $param['params'] ) && empty( $value ) ) {
$defaults = vc_map_get_params_defaults( $param['params'] );
$value = urlencode( json_encode( array( $defaults ) ) );
}
return $value;
}
@@ -0,0 +1,208 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder shortcodes attributes class.
*
* This class and functions represents ability which will allow you to create attributes settings fields to
* control new attributes.
* New attributes can be added to shortcode settings by using param array in wp_map function
*
* @package WPBakeryPageBuilder
*
*/
/**
* Shortcode params class allows to create new params types.
* class WpbakeryShortcodeParams
* @since 4.2
*/
class WpbakeryShortcodeParams {
/**
* @since 4.2
* @var array - store shortcode attributes types
*/
protected static $params = array();
/**
* @since 4.2
* @var array - store shortcode javascript files urls
*/
protected static $scripts = array();
/**
* @since 4.2
* @var array
*/
protected static $enqueue_script = array();
/**
* @since 4.2
* @var array
*/
protected static $scripts_to_register = array();
/**
* @since 4.2
* @var bool
*/
protected static $is_enqueue = false;
/**
* @since 4.7
* @var array - store params not required to init
*/
protected static $optional_init_params = array();
/**
* Get list of params that need to be initialized
*
* @return string[]
*/
public static function getRequiredInitParams() {
$all_params = array_keys( self::$params );
$optional_params = apply_filters( 'vc_edit_form_fields_optional_params', self::$optional_init_params );
$required_params = array_diff( $all_params, $optional_params );
return $required_params;
}
/**
* @since 4.2
*
* @param $script
*/
public static function registerScript( $script ) {
$script_name = 'vc_edit_form_enqueue_script_' . md5( $script );
self::$enqueue_script[] = array(
'name' => $script_name,
'script' => $script,
);
}
/**
* @deprecated 4.4 - TODO check for usage
* @not used
* @since 4.2
*/
public static function enqueueScripts() {
// _deprecated_function( 'WpbakeryShortcodeParams::enqueueScripts', '4.4' );
if ( self::isEnqueue() ) {
foreach ( self::$enqueue_script as $item ) {
wp_register_script( $item['name'], $item['script'], array(
'jquery',
'wp-color-picker',
), WPB_VC_VERSION, true );
wp_enqueue_script( $item['name'] );
}
}
}
/**
* Create new attribute type
*
* @static
* @since 4.2
*
* @param $name - attribute name
* @param $form_field_callback - hook, will be called when settings form is shown and attribute added to shortcode
* param list
* @param $script_url - javascript file url which will be attached at the end of settings form.
*
* @return bool - return true if attribute type created
*/
public static function addField( $name, $form_field_callback, $script_url = null ) {
$result = false;
if ( ! empty( $name ) && ! empty( $form_field_callback ) ) {
self::$params[ $name ] = array(
'callbacks' => array(
'form' => $form_field_callback,
),
);
$result = true;
if ( is_string( $script_url ) && ! in_array( $script_url, self::$scripts ) ) {
self::registerScript( $script_url );
self::$scripts[] = $script_url;
}
}
return $result;
}
/**
* Calls hook for attribute type
* @since 4.2
* @static
*
* @param $name - attribute name
* @param $param_settings - attribute settings from shortcode
* @param $param_value - attribute value
* @param $tag - attribute tag
*
* @return mixed|string - returns html which will be render in hook
*/
public static function renderSettingsField( $name, $param_settings, $param_value, $tag ) {
if ( isset( self::$params[ $name ]['callbacks']['form'] ) ) {
return call_user_func( self::$params[ $name ]['callbacks']['form'], $param_settings, $param_value, $tag );
}
return '';
}
/**
* List of javascript files urls for shortcode attributes.
* @since 4.2
* @static
* @return array - list of js scripts
*/
public static function getScripts() {
return self::$scripts;
}
/**
* @since 4.2
*
* @param $value
*/
public static function setEnqueue( $value ) {
self::$is_enqueue = (boolean) $value;
}
/**
* @since 4.2
* @return bool
*/
public static function isEnqueue() {
return self::$is_enqueue;
}
}
/**
* Helper function to register new shortcode attribute hook.
*
* @param $name - attribute name
* @param $form_field_callback - hook, will be called when settings form is shown and attribute added to shortcode
* param list
* @param $script_url - javascript file url which will be attached at the end of settings form.
*
* @since 4.4
* @return bool
*/
function vc_add_shortcode_param( $name, $form_field_callback, $script_url = null ) {
return WpbakeryShortcodeParams::addField( $name, $form_field_callback, $script_url );
}
/**
* Call hook for attribute.
*
* @param $name - attribute name
* @param $param_settings - attribute settings from shortcode
* @param $param_value - attribute value
* @param $tag - attribute tag
*
* @since 4.4
* @return mixed|string - returns html which will be render in hook
*/
function vc_do_shortcode_param_settings_field( $name, $param_settings, $param_value, $tag ) {
return WpbakeryShortcodeParams::renderSettingsField( $name, $param_settings, $param_value, $tag );
}
@@ -0,0 +1,45 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
global $vc_params_preset_form_field_js_appended;
$vc_params_preset_form_field_js_appended = false;
/**
* Params preset shortcode attribute type generator.
*
* Allows to set list of attributes which will be
*
* @param $settings
* @param $value
*
* @since 4.4
* @return string - html string.
*/
function vc_params_preset_form_field( $settings, $value ) {
$output = '';
$output .= '<select name="'
. $settings['param_name']
. '" class="wpb_vc_param_value vc_params-preset-select '
. $settings['param_name']
. ' ' . $settings['type']
. '">';
foreach ( $settings['options'] as $option ) {
$selected = '';
if ( isset( $option['value'] ) ) {
$option_value_string = (string) $option['value'];
$value_string = (string) $value;
if ( '' !== $value && $option_value_string === $value_string ) {
$selected = ' selected';
}
$output .= '<option class="vc_params-preset-' . $option['value']
. '" value="' . esc_attr( $option['value'] )
. '"' . $selected
. ' data-params="' . esc_attr( json_encode( $option['params'] ) ) . '">'
. esc_html( isset( $option['label'] ) ? $option['label'] : $option['value'] ) . '</option>';
}
}
$output .= '</select>';
return $output;
}
@@ -0,0 +1,183 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @param $settings
* @param $value
*
* @since 4.2
* @return string
*/
function vc_sorted_list_form_field( $settings, $value ) {
return '<div class="vc_sorted-list">'
. '<input name="' . $settings['param_name'] . '" class="wpb_vc_param_value ' . $settings['param_name'] . ' ' . $settings['type'] . '_field" type="hidden" value="' . $value . '" />'
. '<div class="vc_sorted-list-toolbar">' . vc_sorted_list_parts_list( $settings['options'] ) . '</div>'
. '<ul class="vc_sorted-list-container"></ul>'
. '</div>';
}
/**
* Teaser box meta box generator for post's edit page.
* @since 4.2
* The instance of this class is called from
*/
class Vc_Teaser_Box {
/**
* @since 4.2
* @var string
*/
protected static $meta_data_name = 'vc_teaser';
/**
* @since 4.4 (code inspection)
* @var bool
*/
public $teaser_data = false;
/**
* Add action hook to create Meta box. On admin_init jsComposerEditPage method is called.
* @since 4.2
*/
public function init() {
add_action( 'admin_init', array( $this, 'jsComposerEditPage' ), 6 );
}
/**
* Calls add_meta_box function for generating
* @since 4.2
*/
public function jsComposerEditPage() {
$pt_array = vc_editor_post_types();
foreach ( $pt_array as $pt ) {
add_meta_box( 'vc_teaser', __( 'VC: Custom Teaser', 'js_composer' ), array(
$this,
'outputTeaser',
), $pt, 'side' );
}
add_action( 'save_post', array( $this, 'saveTeaserMetaBox' ) );
}
/**
* Get teaser box data from database.
*
* @param $name
* @param bool $id
*
* @since 4.2
* @return string
*/
public function getTeaserData( $name, $id = false ) {
if ( false === $id ) {
$id = get_the_ID();
}
$this->teaser_data = get_post_meta( $id, self::$meta_data_name, true );
return isset( $this->teaser_data[ $name ] ) ? $this->teaser_data[ $name ] : '';
}
/**
* Outputs teaser box html content.
*
* @since 4.2
*/
public function outputTeaser() {
wp_enqueue_script( 'wpb_jscomposer_teaser_js' );
wp_localize_script( 'wpb_jscomposer_teaser_js', 'i18nVcTeaser', array(
'empty_title' => __( 'Empty title', 'js_composer' ),
'text_label' => __( 'Text', 'js_composer' ),
'image_label' => __( 'Image', 'js_composer' ),
'title_label' => __( 'Title', 'js_composer' ),
'link_label' => __( 'Link', 'js_composer' ),
'text_text' => __( 'Text', 'js_composer' ),
'text_excerpt' => __( 'Excerpt', 'js_composer' ),
'text_custom' => __( 'Custom', 'js_composer' ),
'image_featured' => __( 'Featered', 'js_composer' ),
'image_custom' => __( 'Custom', 'js_composer' ),
'link_label_text' => __( 'Link text', 'js_composer' ),
'no_link' => __( 'No link', 'js_composer' ),
'link_post' => __( 'Link to post', 'js_composer' ),
'link_big_image' => __( 'Link to big image', 'js_composer' ),
'add_custom_image' => __( 'Add custom image', 'js_composer' ),
) );
$output = '<div class="vc_teaser-switch"><label><input type="checkbox" name="' . self::$meta_data_name . '[enable]" value="1" id="vc_teaser-checkbox"' . ( '1' === $this->getTeaserData( 'enable' ) ? ' checked="true"' : '' ) . '> ' . __( 'Enable custom teaser', 'js_composer' ) . '</label></div>';
$output .= '<input type="hidden" name="' . self::$meta_data_name . '[data]" class="vc_teaser-data-field" value="' . htmlspecialchars( $this->getTeaserData( 'data' ) ) . '">';
$output .= '<div class="vc_teaser-constructor-hint">';
$output .= '<p>' . __( 'Customize teaser block design to overwrite default settings used in "Carousel" content element.', 'js_composer' ) . '</p>';
$output .= '</div>';
$output .= '<div class="vc_teaser-constructor">';
$output .= '<div class="vc_toolbar"></div>';
$output .= '<div class="clear vc_teaser-list"></div>';
$output .= '<div class="vc_teaser_loading_block" style="display: none;">';
$output .= '<img src="' . get_site_url() . '/wp-admin/images/wpspin_light.gif" /></div>';
$output .= '<div class="vc_teaser-footer"><label>Background color</label><br/><input type="text" name="' . self::$meta_data_name . '[bgcolor]" value="' . htmlspecialchars( $this->getTeaserData( 'bgcolor' ) ) . '" class="vc_teaser-bgcolor"></div>';
$output .= '</div>';
require_once vc_path_dir( 'TEMPLATES_DIR', 'teaser.html.php' );
echo $output;
}
/**
* @param $post_id
*
* @since 4.2
*/
public function saveTeaserMetaBox( $post_id ) {
if ( isset( $_POST[ self::$meta_data_name ] ) ) {
$options = isset( $_POST[ self::$meta_data_name ] ) ? $_POST[ self::$meta_data_name ] : '';
update_post_meta( (int) $post_id, self::$meta_data_name, $options );
}
}
}
/**
* @param $list
*
* @since 4.2
* @return string
*/
function vc_sorted_list_parts_list( $list ) {
$output = '';
foreach ( $list as $control ) {
$output .= '<div class="vc_sorted-list-checkbox"><label><input type="checkbox" name="vc_sorted_list_element" value="' . $control[0] . '" data-element="' . $control[0] . '" data-subcontrol="' . ( count( $control ) > 1 ? htmlspecialchars( json_encode( array_slice( $control, 2 ) ) ) : '' ) . '"> <span>' . htmlspecialchars( $control[1] ) . '</span></label></div>';
}
return $output;
}
/**
* @param $value
*
* @since 4.2
* @return array
*/
function vc_sorted_list_parse_value( $value ) {
$data = array();
$split = preg_split( '/\,/', $value );
foreach ( $split as $v ) {
$v_split = array_map( 'rawurldecode', preg_split( '/\|/', $v ) );
if ( count( $v_split ) > 0 ) {
$data[] = array( $v_split[0], count( $v_split ) > 1 ? array_slice( $v_split, 1 ) : array() );
}
}
return $data;
}
global $vc_teaser_box;
$vc_teaser_box = new Vc_Teaser_Box();
/**
* @param $attributes
*
* @since 4.2
* @return mixed
*/
function vc_add_teaser_box_generator( $attributes ) {
global $vc_teaser_box;
$vc_teaser_box->init();
return $attributes;
}
add_filter( 'vc_mapper_attribute_sorted_list', 'vc_add_teaser_box_generator' );
@@ -0,0 +1,22 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @param $settings
* @param $value
*
* @since 4.2
* @return string
*/
function vc_tab_id_form_field( $settings, $value ) {
return '<div class="my_param_block">'
. '<input name="' . $settings['param_name']
. '" class="wpb_vc_param_value wpb-textinput '
. $settings['param_name'] . ' ' . $settings['type'] . '_field" type="hidden" value="'
. $value . '" />'
. '<label>' . $value . '</label>'
. '</div>';
}
@@ -0,0 +1,46 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
global $vc_html_editor_already_is_use;
$vc_html_editor_already_is_use = false;
/**
* @param $settings
* @param $value
*
* @since 4.2
* @return string
*/
function vc_textarea_html_form_field( $settings, $value ) {
global $vc_html_editor_already_is_use;
$output = '';
if ( false !== $vc_html_editor_already_is_use ) {
$output .= '<textarea name="'
. $settings['param_name']
. '" class="wpb_vc_param_value wpb-textarea '
. $settings['param_name'] . ' textarea">' . $value . '</textarea>';
$output .= '<div class="updated"><p>'
. sprintf( __( 'Field type is changed from "textarea_html" to "textarea", because it is already used by %s field. Textarea_html field\'s type can be used only once per shortcode.', 'js_composer' ), $vc_html_editor_already_is_use )
. '</p></div>';
} elseif ( function_exists( 'wp_editor' ) ) {
$default_content = $value;
// WP 3.3+
ob_start();
wp_editor( '', 'wpb_tinymce_' . $settings['param_name'], array(
'editor_class' => 'wpb-textarea visual_composer_tinymce ' . $settings['param_name'] . ' ' . $settings['type'],
'media_buttons' => true,
'wpautop' => false,
) );
$output_value = ob_get_contents();
ob_end_clean();
$output .= $output_value
. '<input type="hidden" name="' . $settings['param_name']
. '" class="vc_textarea_html_content wpb_vc_param_value '
. $settings['param_name']
. '" value="' . htmlspecialchars( $default_content ) . '"/>';
$vc_html_editor_already_is_use = $settings['param_name'];
}
return $output;
}
@@ -0,0 +1,273 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
class Vc_Grid_Element {
protected $template = '';
protected $html_template = false;
protected $post = false;
protected $attributes = array();
protected $grid_atts = array();
protected $is_end = false;
protected static $templates_added = false;
protected $shortcodes = array(
'vc_gitem_row',
'vc_gitem_col',
'vc_gitem_post_title',
'vc_gitem_icon',
);
public function shortcodes() {
return $this->shortcodes;
}
function setTemplate( $template ) {
$this->template = $template;
$this->parseTemplate( $template );
}
function template() {
return $this->template;
}
public function parseTemplate( $template ) {
$this->setShortcodes();
$this->html_template = do_shortcode( $template );
}
function renderItem( WP_Post $post ) {
$attributes = $this->attributes();
$pattern = array();
$replacement = array();
foreach ( $attributes as $attr ) {
$pattern[] = '/\{\{' . preg_quote( $attr, '' ) . '\}\}/';
$replacement[] = $this->attribute( $attr, $post );
}
$css_class_items = 'vc_grid-item ' . ( $this->isEnd() ? ' vc_grid-last-item ' : '' )
. ' vc_grid-thumb vc_theme-thumb-full-overlay vc_animation-slide-left vc_col-sm-'
. $this->gridAttribute( 'element_width', 12 );
foreach ( $post->filter_terms as $t ) {
$css_class_items .= ' vc_grid-term-' . $t;
}
return '<div class="'
. $css_class_items
. '">' . "\n" . preg_replace( $pattern, $replacement, $this->html_template )
. "\n" . '</div>' . "\n";
}
public function renderParam() {
$output = '<div class="vc_grid-element-constructor" data-vc-grid-element="builder"></div>'
. '<a href="#" data-vc-control="add-row">' . __( 'Add row', 'js_composer' ) . '</a>';
if ( false === self::$templates_added ) {
foreach ( $this->shortcodes as $tag ) {
$method = vc_camel_case( $tag . '_template' );
if ( method_exists( $this, $method ) ) {
$content = $this->$method();
} else {
$content = $this->vcDefaultTemplate( $tag );
}
$output .= '<script type="text/template" data-vc-grid-element-template="'
. esc_attr( $tag ) . '">' . $content . '</script>';
$output .= '<script type="text/template" data-vc-grid-element-template="modal">'
. '<div class="vc_grid-element-modal-title"><# title #></div>'
. '<div class="vc_grid-element-modal-controls"><# controls #></div>'
. '<div class="vc_grid-element-modal-body"><# body #></div>'
. '</script>';
}
self::$templates_added = true;
}
return $output;
}
public function setGridAttributes( $grid_atts ) {
$this->grid_atts = $grid_atts;
}
public function gridAttribute( $name, $default = '' ) {
return isset( $this->grid_atts[ $name ] ) ? $this->grid_atts[ $name ] : $default;
}
public function setAttribute( $name ) {
$this->attributes[] = $name;
}
public function attributes() {
return $this->attributes;
}
public function attribute( $name, $post ) {
if ( method_exists( $this, 'attribute' . ucfirst( $name ) ) ) {
$method_name = 'attribute' . ucfirst( $name );
return $this->$method_name( $post );
}
if ( isset( $post->$name ) ) {
return $post->$name;
}
return '';
}
public function setIsEnd( $is_end = true ) {
$this->is_end = $is_end;
}
public function isEnd() {
return $this->is_end;
}
/**
* Set elements templates.
*/
protected function setShortcodes() {
foreach ( $this->shortcodes as $tag ) {
add_shortcode( $tag, array( $this, vc_camel_case( $tag . '_shortcode' ) ) );
}
}
// Templates {{
public function vcGitemRowShortcode( $atts, $content = '' ) {
return '<div class="vc_row vc_gitem-row'
. $this->gridAttribute( 'element_width' ) . '">'
. "\n" . do_shortcode( $content ) . "\n" . '</div>';
}
public function vcGitemRowTemplate() {
$output = '<div class="vc_gitem-wrapper">';
$output .= '<div class="vc_t-grid-controls vc_t-grid-controls-row" data-vc-element-shortcode="controls">';
// Move control
$output .= '<a class="vc_t-grid-control vc_t-grid-control-move" href="#" title="'
. __( 'Drag row to reorder', 'js_composer' ) . '" data-vc-element-control="move"><i class="vc_t-grid-icon vc_t-grid-icon-move"></i></a>';
// Layout control
$output .= '<span class="vc_t-grid-control vc_t-grid-control-layouts" style="display: none;">'
// vc_col-sm-12
. '<a class="vc_t-grid-control vc_t-grid-control-layout" data-cells="12" title="'
. '1/1' . '" data-vc-element-control="layouts">'
. '<i class="vc_t-grid-icon vc_t-grid-icon-layout-12"></i></a>'
// vc_col-sm-6 + vc_col-sm-6
. '<a class="vc_t-grid-control vc_t-grid-control-layout" data-cells="6_6" title="'
. '1/2 + 1/2' . '" data-vc-element-control="layouts">'
. '<i class="vc_t-grid-icon vc_t-grid-icon-layout-6-6"></i></a>'
// vc_col-sm-4 + vc_col-sm-4 + vc_col-sm-4
. '<a class="vc_t-grid-control vc_t-grid-control-layout" data-cells="4_4_4" title="'
. '1/3 + 1/3 + 1/3' . '" data-vc-element-control="layouts">'
. '<i class="vc_t-grid-icon vc_t-grid-icon-layout-4-4-4"></i></a>'
. '</span>'
. '<span class="vc_pull-right">'
// Destroy control
. '<a class="vc_t-grid-control vc_t-grid-control-destroy" href="#" title="'
. __( 'Delete this row', 'js_composer' ) . '" data-vc-element-control="destroy">'
. '<i class="vc_t-grid-icon vc_t-grid-icon-destroy"></i>'
. '</a>'
. '</span>';
$output .= '</div>';
$output .= '<div data-vc-element-shortcode="content" class="vc_row vc_gitem-content"></div>';
$output .= '</div>';
return $output;
}
public function vcGitemColShortcode( $atts, $content = '' ) {
$width = '12';
$atts = shortcode_atts( array(
'width' => '12',
), $atts );
extract( $atts );
return '<div class="vc_col-sm-' . $width . ' vc_gitem-col">'
. "\n" . do_shortcode( $content ) . "\n" . '</div>';
}
public function vcGitemColTemplate() {
$output = '<div class="vc_gitem-wrapper">';
// Controls
// Control "Add"
$controls = '<a class="vc_t-grid-control vc_t-grid-control-add" href="#" title="'
. __( 'Prepend to this column', 'js_composer' ) . '" data-vc-element-control="add">'
. '<i class="vc_t-grid-icon vc_t-grid-icon-add"></i>'
. '</a>';
$output .= '<div class="vc_t-grid-controls vc_t-grid-controls-col" data-vc-element-shortcode="controls">'
. $controls
. '</div>';
// Content
$output .= '<div data-vc-element-shortcode="content" class="vc_gitem-content">'
. '</div>';
/*
$output .= '<div class="vc_t-grid-controls vc_t-grid-controls-col vc_t-grid-controls-bottom">'
.$controls
. '</div>';
*/
$output .= '</div>';
return $output;
}
public function vcGitemPostTitleShortcode( $atts, $content = '' ) {
$atts = shortcode_atts( array(), $atts );
extract( $atts );
$this->setAttribute( 'post_title' );
return '<h3 data-vc-element-shortcode="content" class="vc_ptitle">{{post_title}}</h3>';
}
public function vcDefaultTemplate( $tag ) {
$name = preg_replace( '/^vc_gitem_/', '', $tag );
$title = ucfirst( preg_replace( '/\_/', ' ', $name ) );
return '<div class="vc_gitem-wrapper">'
. $this->elementControls( $title, preg_match( '/^post/', $name ) ? 'orange' : 'green' )
. '</div>';
}
protected function elementControls( $title, $theme = null ) {
return '<div class="vc_t-grid-controls vc_t-grid-controls-element'
. ( is_string( $theme ) ? ' vc_th-controls-element-' . $theme : '' )
. '" data-vc-element-shortcode="controls">'
// Move control
. '<a class="vc_t-grid-control vc_t-grid-control-move" href="#" title="'
. __( 'Drag to reorder', 'js_composer' ) . '" data-vc-element-control="move">'
. '<i class="vc_t-grid-icon vc_t-grid-icon-move"></i>'
. '</a>'
// Label
. '<span class="vc_t-grid-control vc_t-grid-control-name" data-vc-element-control="name">
' . $title
. '</span>'
// Edit control
. '<a class="vc_t-grid-control vc_t-grid-control-edit" data-vc-element-control="edit">'
. '<i class="vc_t-grid-icon vc_t-grid-icon-edit"></i>'
. '</a>'
// Delete control
. '<a class="vc_t-grid-control vc_t-grid-control-destroy" data-vc-element-control="destroy">'
. '<i class="vc_t-grid-icon vc_t-grid-icon-destroy"></i>'
. '</a>'
. '</div>';
}
// }}
}
function vc_vc_grid_element_form_field( $settings, $value ) {
$grid_element = new Vc_Grid_Element();
return '<div data-vc-grid-element="container" data-vc-grid-tags-list="'
. esc_attr( json_encode( $grid_element->shortcodes() ) ) . '">'
. '<input data-vc-grid-element="value" type="hidden" name="' . $settings['param_name']
. '" class="wpb_vc_param_value wpb-textinput '
. $settings['param_name'] . ' ' . $settings['type'] . '_field" '
. ' value="'
. esc_attr( $value ) . '">'
. $grid_element->renderParam()
. '</div>';
}
function vc_load_vc_grid_element_param() {
vc_add_shortcode_param(
'vc_grid_element',
'vc_vc_grid_element_form_field'
);
}
add_action( 'vc_load_default_params', 'vc_load_vc_grid_element_param' );
@@ -0,0 +1,20 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @param $settings
* @param $value
*
* @since 4.4.3
* @return string
*/
function vc_vc_grid_id_form_field( $settings, $value ) {
return '<div class="vc_param-vc-grid-id">'
. '<input name="' . $settings['param_name']
. '" class="wpb_vc_param_value wpb-textinput '
. $settings['param_name'] . ' ' . $settings['type'] . '_field" type="hidden" value="'
. $value . '" />'
. '</div>';
}
@@ -0,0 +1,437 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Build css classes from terms of the post.
*
* @param $value
* @param $data
*
* @since 4.4
*
* @return string
*/
function vc_gitem_template_attribute_filter_terms_css_classes( $value, $data ) {
$output = '';
/**
* @var null|Wp_Post $post ;
*/
extract( array_merge( array(
'post' => null,
), $data ) );
if ( isset( $post->filter_terms ) && is_array( $post->filter_terms ) ) {
foreach ( $post->filter_terms as $t ) {
$output .= ' vc_grid-term-' . $t; // @todo fix #106154391786878 $t is array
}
}
return $output;
}
/**
* Get image for post
*
* @param $data
* @return mixed|string|void
*/
function vc_gitem_template_attribute_post_image( $data ) {
/**
* @var null|Wp_Post $post ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
if ( 'attachment' === $post->post_type ) {
return wp_get_attachment_image( $post->ID, 'large' );
}
$html = get_the_post_thumbnail( $post->ID );
return apply_filters( 'vc_gitem_template_attribute_post_image_html', $html );
}
function vc_gitem_template_attribute_featured_image( $value, $data ) {
/**
* @var Wp_Post $post
* @var string $data
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
return vc_include_template( 'params/vc_grid_item/attributes/featured_image.php', array(
'post' => $post,
'data' => $data,
) );
}
/**
* Create new btn
*
* @param $value
* @param $data
*
* @since 4.5
*
* @return mixed
*/
function vc_gitem_template_attribute_vc_btn( $value, $data ) {
/**
* @var Wp_Post $post
* @var string $data
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
return vc_include_template( 'params/vc_grid_item/attributes/vc_btn.php', array(
'post' => $post,
'data' => $data,
) );
}
/**
* Get post image url
*
* @param $value
* @param $data
*
* @return string
*/
function vc_gitem_template_attribute_post_image_url( $value, $data ) {
$output = '';
/**
* @var null|Wp_Post $post ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
$extraImageMeta = explode( ':', $data );
$size = 'large'; // default size
if ( isset( $extraImageMeta[1] ) ) {
$size = $extraImageMeta[1];
}
if ( 'attachment' === $post->post_type ) {
$src = vc_get_image_by_size( $post->ID, $size );
} else {
$attachment_id = get_post_thumbnail_id( $post->ID );
$src = vc_get_image_by_size( $attachment_id, $size );
}
if ( empty( $src ) && ! empty( $data ) ) {
$output = esc_attr( rawurldecode( $data ) );
} elseif ( ! empty( $src ) ) {
$output = is_array( $src ) ? $src[0] : $src;
} else {
$output = vc_asset_url( 'vc/vc_gitem_image.png' );
}
return apply_filters( 'vc_gitem_template_attribute_post_image_url_value', $output );
}
/**
* Get post image url with href for a dom element
*
* @param $value
* @param $data
*
* @return string
*/
function vc_gitem_template_attribute_post_image_url_href( $value, $data ) {
$link = vc_gitem_template_attribute_post_image_url( $value, $data );
return strlen( $link ) ? ' href="' . esc_attr( $link ) . '"' : '';
}
/**
* Add image url as href with css classes for PrettyPhoto js plugin.
*
* @param $value
* @param $data
*
* @return string
*/
function vc_gitem_template_attribute_post_image_url_attr_prettyphoto( $value, $data ) {
$data_default = $data;
/**
* @var Wp_Post $post ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
$href = vc_gitem_template_attribute_post_image_url_href( $value, array( 'post' => $post, 'data' => '' ) );
$rel = ' data-rel="' . esc_attr( 'prettyPhoto[rel-' . md5( vc_request_param( 'shortcode_id' ) ) . ']' ) . '"';
return $href . $rel . ' class="' . esc_attr( $data . ( strlen( $href ) ? ' prettyphoto' : '' ) )
. '" title="' . esc_attr(
apply_filters( 'vc_gitem_template_attribute_post_title', $post->post_title, $data_default ) ) . '"';
}
/**
* Get post image alt
*
* @param $value
* @param $data
* @return string
*/
function vc_gitem_template_attribute_post_image_alt( $value, $data ) {
if ( empty( $data['post']->ID ) ) {
return '';
}
if ( 'attachment' === $data['post']->post_type ) {
$attachment_id = $data['post']->ID;
} else {
$attachment_id = get_post_thumbnail_id( $data['post']->ID );
}
if ( ! $attachment_id ) {
return '';
}
$alt = trim( strip_tags( get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ) ) );
return apply_filters( 'vc_gitem_template_attribute_post_image_url_value', $alt );
}
/**
* Get post image url
*
* @param $value
* @param $data
* @return string
*/
function vc_gitem_template_attribute_post_image_background_image_css( $value, $data ) {
$output = '';
/**
* @var null|Wp_Post $post ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
$size = 'large'; // default size
if ( ! empty( $data ) ) {
$size = $data;
}
if ( 'attachment' === $post->post_type ) {
$src = vc_get_image_by_size( $post->ID, $size );
} else {
$attachment_id = get_post_thumbnail_id( $post->ID );
$src = vc_get_image_by_size( $attachment_id, $size );
}
if ( ! empty( $src ) ) {
$output = 'background-image: url(\'' . ( is_array( $src ) ? $src[0] : $src ) . '\') !important;';
} else {
$output = 'background-image: url(\'' . vc_asset_url( 'vc/vc_gitem_image.png' ) . '\') !important;';
}
return apply_filters( 'vc_gitem_template_attribute_post_image_background_image_css_value', $output );
}
/**
* Get post link
*
* @param $value
* @param $data
* @return bool|string
*/
function vc_gitem_template_attribute_post_link_url( $value, $data ) {
/**
* @var null|Wp_Post $post ;
*/
extract( array_merge( array(
'post' => null,
), $data ) );
return get_permalink( $post->ID );
}
/**
* Get post date
*
* @param $value
* @param $data
* @return bool|int|string
*/
function vc_gitem_template_attribute_post_date( $value, $data ) {
/**
* @var null|Wp_Post $post ;
*/
extract( array_merge( array(
'post' => null,
), $data ) );
return get_the_date( '', $post->ID );
}
/**
* Get post date time
*
* @param $value
* @param $data
* @return bool|int|string
*/
function vc_gitem_template_attribute_post_datetime( $value, $data ) {
/**
* @var null|Wp_Post $post ;
*/
extract( array_merge( array(
'post' => null,
), $data ) );
return get_the_time( 'F j, Y g:i', $post->ID );
}
/**
* Get custom fields.
*
* @param $value
* @param $data
* @return mixed|string
*/
function vc_gitem_template_attribute_post_meta_value( $value, $data ) {
/**
* @var null|Wp_Post $post ;
* @var string $data ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
return strlen( $data ) > 0 ? get_post_meta( $post->ID, $data, true ) : $value;
}
/**
* Get post data. Used as wrapper for others post data attributes.
*
* @param $value
* @param $data
* @return mixed|string
*/
function vc_gitem_template_attribute_post_data( $value, $data ) {
/**
* @var null|Wp_Post $post ;
* @var string $data ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
return strlen( $data ) > 0 ? apply_filters( 'vc_gitem_template_attribute_' . $data, (
isset( $post->$data ) ? $post->$data : ''
), array( 'post' => $post, 'data' => '' ) ) : $value;
}
/**
* Get post excerpt. Used as wrapper for others post data attributes.
*
* @param $value
* @param $data
* @return mixed|string
*/
function vc_gitem_template_attribute_post_excerpt( $value, $data ) {
/**
* @var null|Wp_Post $post ;
* @var string $data ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
return apply_filters( 'the_excerpt', apply_filters( 'get_the_excerpt', $value ) );
}
/**
* Get post excerpt. Used as wrapper for others post data attributes.
*
* @param $value
* @param $data
* @return mixed|string
*/
function vc_gitem_template_attribute_post_title( $value, $data ) {
/**
* @var null|Wp_Post $post ;
* @var string $data ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
return the_title( '', '', false );
}
function vc_gitem_template_attribute_post_author( $value, $data ) {
/**
* @var null|Wp_Post $post ;
* @var string $data ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
return get_the_author();
}
function vc_gitem_template_attribute_post_author_href( $value, $data ) {
/**
* @var null|Wp_Post $post ;
* @var string $data ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
return get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) );
}
function vc_gitem_template_attribute_post_categories( $value, $data ) {
/**
* @var null|Wp_Post $post ;
* @var string $data ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
$atts_extended = array();
parse_str( $data, $atts_extended );
return vc_include_template( 'params/vc_grid_item/attributes/post_categories.php', array(
'post' => $post,
'atts' => $atts_extended['atts'],
) );
}
/**
* Adding filters to parse grid template.
*/
add_filter( 'vc_gitem_template_attribute_filter_terms_css_classes', 'vc_gitem_template_attribute_filter_terms_css_classes', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_image', 'vc_gitem_template_attribute_post_image', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_image_url', 'vc_gitem_template_attribute_post_image_url', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_image_url_href', 'vc_gitem_template_attribute_post_image_url_href', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_image_url_attr_prettyphoto', 'vc_gitem_template_attribute_post_image_url_attr_prettyphoto', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_image_alt', 'vc_gitem_template_attribute_post_image_alt', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_link_url', 'vc_gitem_template_attribute_post_link_url', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_date', 'vc_gitem_template_attribute_post_date', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_datetime', 'vc_gitem_template_attribute_post_datetime', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_meta_value', 'vc_gitem_template_attribute_post_meta_value', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_data', 'vc_gitem_template_attribute_post_data', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_image_background_image_css', 'vc_gitem_template_attribute_post_image_background_image_css', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_excerpt', 'vc_gitem_template_attribute_post_excerpt', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_title', 'vc_gitem_template_attribute_post_title', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_author', 'vc_gitem_template_attribute_post_author', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_author_href', 'vc_gitem_template_attribute_post_author_href', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_categories', 'vc_gitem_template_attribute_post_categories', 10, 2 );
add_filter( 'vc_gitem_template_attribute_featured_image', 'vc_gitem_template_attribute_featured_image', 10, 2 );
add_filter( 'vc_gitem_template_attribute_vc_btn', 'vc_gitem_template_attribute_vc_btn', 10, 2 );
@@ -0,0 +1,377 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_Grid_Item to build grid item.
*/
class Vc_Grid_Item {
protected $template = '';
protected $html_template = false;
protected $post = false;
protected $grid_atts = array();
protected $is_end = false;
protected static $templates_added = false;
protected $shortcodes = false;
protected $found_variables = false;
protected static $predefined_templates = false;
protected $template_id = false;
protected static $custom_fields_meta_data = false;
/**
* Get shortcodes to build vc grid item templates.
*
* @return bool|mixed|void
*/
public function shortcodes() {
if ( false === $this->shortcodes ) {
$this->shortcodes = include vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/shortcodes.php' );
$this->shortcodes = apply_filters( 'vc_grid_item_shortcodes', $this->shortcodes );
}
add_filter( 'vc_shortcode_set_template_vc_icon', array(
$this,
'addVcIconShortcodesTemplates',
) );
add_filter( 'vc_shortcode_set_template_vc_button2', array(
$this,
'addVcButton2ShortcodesTemplates',
) );
add_filter( 'vc_shortcode_set_template_vc_single_image', array(
$this,
'addVcSingleImageShortcodesTemplates',
) );
add_filter( 'vc_shortcode_set_template_vc_custom_heading', array(
$this,
'addVcCustomHeadingShortcodesTemplates',
) );
add_filter( 'vc_shortcode_set_template_vc_btn', array(
$this,
'addVcBtnShortcodesTemplates',
) );
return $this->shortcodes;
}
/**
* Used by filter vc_shortcode_set_template_vc_icon to set custom template for vc_icon shortcode.
*
* @param $template
*
* @return string
*/
public function addVcIconShortcodesTemplates( $template ) {
if ( Vc_Grid_Item_Editor::postType() === WPBMap::getScope() ) {
$file = vc_path_dir( 'TEMPLATES_DIR', 'params/vc_grid_item/shortcodes/vc_icon.php' );
if ( is_file( $file ) ) {
return $file;
}
}
return $template;
}
/**
* Used by filter vc_shortcode_set_template_vc_button2 to set custom template for vc_button2 shortcode.
*
* @param $template
*
* @return string
*/
public function addVcButton2ShortcodesTemplates( $template ) {
if ( Vc_Grid_Item_Editor::postType() === WPBMap::getScope() ) {
$file = vc_path_dir( 'TEMPLATES_DIR', 'params/vc_grid_item/shortcodes/vc_button2.php' );
if ( is_file( $file ) ) {
return $file;
}
}
return $template;
}
/**
* Used by filter vc_shortcode_set_template_vc_single_image to set custom template for vc_single_image shortcode.
*
* @param $template
*
* @return string
*/
public function addVcSingleImageShortcodesTemplates( $template ) {
if ( Vc_Grid_Item_Editor::postType() === WPBMap::getScope() ) {
$file = vc_path_dir( 'TEMPLATES_DIR', 'params/vc_grid_item/shortcodes/vc_single_image.php' );
if ( is_file( $file ) ) {
return $file;
}
}
return $template;
}
/**
* Used by filter vc_shortcode_set_template_vc_custom_heading to set custom template for vc_custom_heading
* shortcode.
*
* @param $template
*
* @return string
*/
public function addVcCustomHeadingShortcodesTemplates( $template ) {
if ( Vc_Grid_Item_Editor::postType() === WPBMap::getScope() ) {
$file = vc_path_dir( 'TEMPLATES_DIR', 'params/vc_grid_item/shortcodes/vc_custom_heading.php' );
if ( is_file( $file ) ) {
return $file;
}
}
return $template;
}
/**
* Used by filter vc_shortcode_set_template_vc_button2 to set custom template for vc_button2 shortcode.
*
* @param $template
*
* @return string
*/
public function addVcBtnShortcodesTemplates( $template ) {
if ( Vc_Grid_Item_Editor::postType() === WPBMap::getScope() ) {
$file = vc_path_dir( 'TEMPLATES_DIR', 'params/vc_grid_item/shortcodes/vc_btn.php' );
if ( is_file( $file ) ) {
return $file;
}
}
return $template;
}
/**
* Map shortcodes for vc_grid_item param type.
*/
public function mapShortcodes() {
// @kludge
// TODO: refactor with with new way of roles for shortcodes.
// NEW ROLES like post_type for shortcode and access policies.
$shortcodes = $this->shortcodes();
foreach ( $shortcodes as $shortcode_settings ) {
vc_map( $shortcode_settings );
}
}
/**
* Get list of predefined templates.
*
* @return bool|mixed
*/
public static function predefinedTemplates() {
if ( false === self::$predefined_templates ) {
self::$predefined_templates = apply_filters( 'vc_grid_item_predefined_templates', include vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/templates.php' ) );
}
return self::$predefined_templates;
}
/**
* @param $id - Predefined templates id
*
* @return array|bool
*/
public static function predefinedTemplate( $id ) {
$predefined_templates = self::predefinedTemplates();
if ( isset( $predefined_templates[ $id ]['template'] ) ) {
return $predefined_templates[ $id ];
}
return false;
}
/**
* Set template which should grid used when vc_grid_item param value is rendered.
*
* @param $id
*
* @return bool
*/
public function setTemplateById( $id ) {
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/templates.php' );
if ( 0 === strlen( $id ) ) {
return false;
}
if ( preg_match( '/^\d+$/', $id ) ) {
$post = get_post( (int) $id );
$post && $this->setTemplate( $post->post_content, $post->ID );
return true;
} elseif ( false !== ( $predefined_template = $this->predefinedTemplate( $id ) ) ) {
$this->setTemplate( $predefined_template['template'], $id );
return true;
}
return false;
}
/**
* Setter for template attribute.
*
* @param $template
* @param $template_id
*/
public function setTemplate( $template, $template_id ) {
$this->template = $template;
$this->template_id = $template_id;
$this->parseTemplate( $template );
}
/**
* Getter for template attribute.
* @return string
*/
function template() {
return $this->template;
}
/**
* Add custom css from shortcodes that were mapped for vc grid item.
* @return string
*/
public function addShortcodesCustomCss() {
$output = $shortcodes_custom_css = '';
$id = $this->template_id;
if ( preg_match( '/^\d+$/', $id ) ) {
$shortcodes_custom_css = get_post_meta( $id, '_wpb_shortcodes_custom_css', true );
} elseif ( false !== ( $predefined_template = $this->predefinedTemplate( $id ) ) ) {
$shortcodes_custom_css = visual_composer()->parseShortcodesCustomCss( $predefined_template['template'] );
}
if ( ! empty( $shortcodes_custom_css ) ) {
$shortcodes_custom_css = strip_tags( $shortcodes_custom_css );
$output .= '<style type="text/css" data-type="vc_shortcodes-custom-css">';
$output .= $shortcodes_custom_css;
$output .= '</style>';
}
return $output;
}
/**
* Generates html with template's variables for rendering new project.
*
* @param $template
*/
public function parseTemplate( $template ) {
$this->mapShortcodes();
WPBMap::addAllMappedShortcodes();
$attr = ' width="' . $this->gridAttribute( 'element_width', 12 ) . '"' . ' is_end="' . ( 'true' === $this->isEnd() ? 'true' : '' ) . '"';
$template = preg_replace( '/(\[(\[?)vc_gitem\b)/', '$1' . $attr, $template );
$template = str_replace( array(
'<p>[vc_gitem',
'[/vc_gitem]</p>',
), array(
'[vc_gitem',
'[/vc_gitem]',
), $template );
$this->html_template .= do_shortcode( trim( $template ) );
}
/**
* Regexp for variables.
* @return string
*/
public function templateVariablesRegex() {
return '/\{\{' . '\{?' . '\s*' . '([^\}\:]+)(\:([^\}]+))?' . '\s*' . '\}\}' . '\}?/';
}
/**
* Get default variables.
*
* @return array|bool
*/
public function getTemplateVariables() {
if ( ! is_array( $this->found_variables ) ) {
preg_match_all( $this->templateVariablesRegex(), $this->html_template, $this->found_variables, PREG_SET_ORDER );
}
return $this->found_variables;
}
/**
* Render item by replacing template variables for exact post.
*
* @param WP_Post $post
*
* @return mixed
*/
function renderItem( WP_Post $post ) {
$pattern = array();
$replacement = array();
$this->addAttributesFilters();
foreach ( $this->getTemplateVariables() as $var ) {
$pattern[] = '/' . preg_quote( $var[0], '/' ) . '/';
$replacement[] = preg_replace( '/\\$/', '\\\$', $this->attribute( $var[1], $post, isset( $var[3] ) ? trim( $var[3] ) : '' ) );
}
return preg_replace( $pattern, $replacement, do_shortcode( $this->html_template ) );
}
/**
* Adds filters to build templates variables values.
*/
public function addAttributesFilters() {
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/attributes.php' );
}
/**
* Getter for Grid shortcode attributes.
*
* @param $grid_atts
*/
public function setGridAttributes( $grid_atts ) {
$this->grid_atts = $grid_atts;
}
/**
* Setter for Grid shortcode attributes.
*
* @param $name
* @param string $default
*
* @return string
*/
public function gridAttribute( $name, $default = '' ) {
return isset( $this->grid_atts[ $name ] ) ? $this->grid_atts[ $name ] : $default;
}
/**
* Get attribute value for WP_post object.
*
* @param $name
* @param $post
* @param string $data
*
* @return mixed|void
*/
public function attribute( $name, $post, $data = '' ) {
$data = html_entity_decode( $data );
return apply_filters( 'vc_gitem_template_attribute_' . trim( $name ), ( isset( $post->$name ) ? $post->$name : '' ), array(
'post' => $post,
'data' => $data,
) );
}
/**
* Set that this is last items in the grid. Used for load more button and lazy loading.
*
* @param bool $is_end
*/
public function setIsEnd( $is_end = true ) {
$this->is_end = $is_end;
}
/**
* Checks is the end.
* @return bool
*/
public function isEnd() {
return $this->is_end;
}
}
@@ -0,0 +1,105 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
class WpbMap_Grid_Item extends WPBMap {
protected static $gitem_user_sc = false;
protected static $gitem_user_categories = false;
protected static $gitem_user_sorted_sc = false;
/**
* Generates list of shortcodes only for Grid element.
*
* This method parses the list of mapped shortcodes and creates categories list for users.
* Also it checks is 'is_grid_item_element' attribute true.
*
* @static
*
* @param bool $force - force data generation even data already generated.
*/
protected static function generateGitemUserData( $force = false ) {
if ( ! $force && false !== self::$gitem_user_sc && false !== self::$gitem_user_categories ) {
return;
}
self::$gitem_user_sc = self::$gitem_user_categories = self::$gitem_user_sorted_sc = array();
$deprecated = 'deprecated';
$add_deprecated = false;
if ( is_array( self::$sc ) && ! empty( self::$sc ) ) {
foreach ( self::$sc as $name => $values ) {
if ( isset( $values['post_type'] ) && Vc_Grid_Item_Editor::postType() === $values['post_type'] && vc_user_access_check_shortcode_all( $name ) ) {
if ( ! isset( $values['content_element'] ) || true === $values['content_element'] ) {
$categories = isset( $values['category'] ) ? $values['category'] : '_other_category_';
$values['_category_ids'] = array();
if ( isset( $values['deprecated'] ) && false !== $values['deprecated'] ) {
$add_deprecated = true;
$values['_category_ids'][] = $deprecated;
} else {
if ( is_array( $categories ) && ! empty( $categories ) ) {
foreach ( $categories as $c ) {
if ( false === array_search( $c, self::$gitem_user_categories ) ) {
self::$gitem_user_categories[] = $c;
}
$values['_category_ids'][] = md5( $c );
}
} else {
if ( false === array_search( $categories, self::$gitem_user_categories ) ) {
self::$gitem_user_categories[] = $categories;
}
$values['_category_ids'][] = md5( $categories );
}
}
}
self::$gitem_user_sc[ $name ] = $values;
self::$gitem_user_sorted_sc[] = $values;
}
}
}
if ( $add_deprecated ) {
self::$gitem_user_categories[] = $deprecated;
}
$sort = new Vc_Sort( self::$gitem_user_sorted_sc );
self::$gitem_user_sorted_sc = $sort->sortByKey();
}
/**
* Get sorted list of mapped shortcode settings grid element
*
* Sorting depends on the weight attribute and mapping order.
*
* @static
* @return array
*/
public static function getSortedGitemUserShortCodes() {
self::generateGitemUserData();
return self::$gitem_user_sorted_sc;
}
/**
* Get list of mapped shortcode settings for current user.
* @static
* @return array - associated array of shortcodes settings with tag as the key.
*/
public static function getGitemUserShortCodes() {
self::generateGitemUserData();
return self::$gitem_user_sc;
}
/**
* Get all categories for current user.
*
* Category is added to the list when at least one shortcode of this category is allowed for current user
* by Vc access rules.
*
* @static
* @return array
*/
public static function getGitemUserCategories() {
self::generateGitemUserData();
return self::$gitem_user_categories;
}
}
@@ -0,0 +1,275 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Manger for new post type for single grid item design with constructor
*
* @package WPBakeryPageBuilder
* @since 4.4
*/
require_once vc_path_dir( 'EDITORS_DIR', 'class-vc-backend-editor.php' );
class Vc_Grid_Item_Editor extends Vc_Backend_Editor {
protected static $post_type = 'vc_grid_item';
protected $templates_editor = false;
/**
* This method is called to add hooks.
*
* @since 4.8
* @access public
*/
public function addHooksSettings() {
add_action( 'add_meta_boxes', array(
$this,
'render',
) );
add_action( 'vc_templates_render_backend_template', array(
$this,
'loadTemplate',
), 10, 2 );
/* add_action( 'vc_ui-template-preview', array(
$this,
'replaceTemplatesPanelEditorJsAction',
) );*/
}
public function addScripts() {
$this->render( get_post_type() );
}
public function render( $post_type ) {
if ( $this->isValidPostType( $post_type ) ) {
$this->registerBackendJavascript();
$this->registerBackendCss();
// B.C:
visual_composer()->registerAdminCss();
visual_composer()->registerAdminJavascript();
add_action( 'admin_print_scripts-post.php', array(
$this,
'printScriptsMessages',
), 300 );
add_action( 'admin_print_scripts-post-new.php', array(
$this,
'printScriptsMessages',
), 300 );
}
}
public function editorEnabled() {
return vc_user_access()->part( 'grid_builder' )->can()->get();
}
public function replaceTemplatesPanelEditorJsAction() {
wp_dequeue_script( 'vc-template-preview-script' );
$this->templatesEditor()->addScriptsToTemplatePreview();
}
/**
* Create post type and new item in the admin menu.
* @return void
*/
public static function createPostType() {
register_post_type( self::$post_type, array(
'labels' => self::getPostTypesLabels(),
'public' => false,
'has_archive' => false,
'show_in_nav_menus' => false,
'exclude_from_search' => true,
'publicly_queryable' => false,
'show_ui' => true,
'show_in_menu' => false,
'query_var' => true,
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => null,
'supports' => array(
'title',
'editor',
),
) );
}
public static function getPostTypesLabels() {
return array(
'add_new_item' => __( 'Add Grid template', 'js_composer' ),
'name' => __( 'Grid Builder', 'js_composer' ),
'singular_name' => __( 'Grid template', 'js_composer' ),
'edit_item' => __( 'Edit Grid template', 'js_composer' ),
'view_item' => __( 'View Grid template', 'js_composer' ),
'search_items' => __( 'Search Grid templates', 'js_composer' ),
'not_found' => __( 'No Grid templates found', 'js_composer' ),
'not_found_in_trash' => __( 'No Grid templates found in Trash', 'js_composer' ),
);
}
/**
* Rewrites validation for correct post_type of th post.
*
* @param string $type
*
* @return bool
*/
public function isValidPostType( $type = '' ) {
$type = ! empty( $type ) ? $type : get_post_type();
return $this->editorEnabled() && $this->postType() === $type;
}
/**
* Get post type for Vc grid element editor.
*
* @static
* @return string
*/
public static function postType() {
return self::$post_type;
}
/**
* Calls add_meta_box to create Editor block.
*
* @access public
*/
public function addMetaBox() {
add_meta_box( 'wpb_visual_composer', __( 'Grid Builder', 'js_composer' ), array(
$this,
'renderEditor',
), $this->postType(), 'normal', 'high' );
}
/**
* Change order of the controls for shortcodes admin block.
*
* @return array
*/
public function shortcodesControls() {
return array(
'delete',
'edit',
);
}
/**
* Output html for backend editor meta box.
*
* @param null|int $post
*
* @return mixed|void
*/
public function renderEditor( $post = null ) {
if ( ! vc_user_access()->part( 'grid_builder' )->can()->get() ) {
return;
}
// add_filter( 'vc_wpbakery_shortcode_get_controls_list', array(
// $this,
// 'shortcodesControls',
// ) );
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php' );
$this->post = $post;
vc_include_template( 'params/vc_grid_item/editor/vc_grid_item_editor.tpl.php', array(
'editor' => $this,
'post' => $this->post,
) );
add_action( 'admin_footer', array(
$this,
'renderEditorFooter',
) );
do_action( 'vc_backend_editor_render' );
do_action( 'vc_vc_grid_item_editor_render' );
add_action( 'vc_user_access_check-shortcode_edit', array(
$this,
'accessCheckShortcodeEdit',
), 10, 2 );
add_action( 'vc_user_access_check-shortcode_all', array(
$this,
'accessCheckShortcodeAll',
), 10, 2 );
return;
}
public function accessCheckShortcodeEdit( $null, $shortcode ) {
return vc_user_access()->part( 'grid_builder' )->can()->get();
}
public function accessCheckShortcodeAll( $null, $shortcode ) {
return vc_user_access()->part( 'grid_builder' )->can()->get();
}
/**
* Output required html and js content for VC editor.
*
* Here comes panels, modals and js objects with data for mapped shortcodes.
*/
public function renderEditorFooter() {
vc_include_template( 'params/vc_grid_item/editor/partials/vc_grid_item_editor_footer.tpl.php', array(
'editor' => $this,
'post' => $this->post,
) );
do_action( 'vc_backend_editor_footer_render' );
}
public function registerBackendJavascript() {
parent::registerBackendJavascript();
wp_register_script( 'vc_grid_item_editor', vc_asset_url( 'js/dist/grid-builder.min.js' ), array( 'vc-backend-min-js' ), WPB_VC_VERSION, true );
wp_localize_script( 'vc_grid_item_editor', 'i18nLocaleGItem', array(
'preview' => __( 'Preview', 'js_composer' ),
'builder' => __( 'Builder', 'js_composer' ),
'add_template_message' => __( 'If you add this template, all your current changes will be removed. Are you sure you want to add template?', 'js_composer' ),
) );
}
public function enqueueJs() {
parent::enqueueJs();
wp_enqueue_script( 'vc_grid_item_editor' );
}
public function templatesEditor() {
if ( false === $this->templates_editor ) {
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/editor/popups/class-vc-templates-editor-grid-item.php' );
$this->templates_editor = new Vc_Templates_Editor_Grid_Item();
}
return $this->templates_editor;
}
public function loadPredefinedTemplate( $template_id, $template_type ) {
ob_start();
$this->templatesEditor()->load( $template_id );
return ob_get_clean();
}
public function loadTemplate( $template_id, $template_type ) {
if ( 'grid_templates' === $template_type ) {
return $this->loadPredefinedTemplate( $template_id, $template_type );
} else if ( 'grid_templates_custom' === $template_type ) {
return $this->templatesEditor()->loadCustomTemplate( $template_id );
}
return $template_id;
}
public function templatePreviewPath( $path ) {
return 'params/vc_grid_item/editor/vc_ui-template-preview.tpl.php';
}
public function renderTemplatePreview() {
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'edit_posts', 'edit_pages' )->validateDie()->part( 'grid_builder' )->can()->validateDie();
add_action( 'vc_templates_render_backend_template_preview', array(
$this,
'loadTemplate',
), 10, 2 );
add_filter( 'vc_render_template_preview_include_template', array(
$this,
'templatePreviewPath',
) );
visual_composer()->templatesPanelEditor()->renderTemplatePreview();
}
}
@@ -0,0 +1,145 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
class Vc_Grid_Item_Preview {
protected $shortcodes_string = '';
protected $post_id = false;
public function render() {
$this->post_id = (int) vc_request_param( 'post_id' );
$this->shortcodes_string = stripslashes( vc_request_param( 'shortcodes_string', true ) );
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php' );
$grid_item = new Vc_Grid_Item();
$grid_item->setIsEnd( false );
$grid_item->setGridAttributes( array( 'element_width' => 4 ) );
$grid_item->setTemplate( $this->shortcodes_string, $this->post_id );
$this->enqueue();
vc_include_template( 'params/vc_grid_item/preview.tpl.php', array(
'preview' => $this,
'grid_item' => $grid_item,
'shortcodes_string' => $this->shortcodes_string,
'post' => $this->mockingPost(),
'default_width_value' => apply_filters( 'vc_grid_item_preview_render_default_width_value', 4 ),
) );
}
public function addCssBackgroundImage( $css ) {
if ( empty( $css ) ) {
$css = 'background-image: url(' . vc_asset_url( 'vc/vc_gitem_image.png' ) . ') !important';
}
return $css;
}
public function addImageUrl( $url ) {
if ( empty( $url ) ) {
$url = vc_asset_url( 'vc/vc_gitem_image.png' );
}
return $url;
}
public function addImage( $img ) {
if ( empty( $img ) ) {
$img = '<img src="' . vc_asset_url( 'vc/vc_gitem_image.png' ) . '" alt="">';
}
return $img;
}
/**
*
* @since 4.5
*
* @param $link
*
* @param $atts
* @param $css_class
* @return string
*/
public function disableContentLink( $link, $atts, $css_class ) {
return 'a' . ( strlen( $css_class ) > 0 ? ' class="' . esc_attr( $css_class ) . '"' : '' );
}
/**
*
* @since 4.5
*
* @param $link
*
* @param $atts
* @param $post
* @param $css_class
* @return string
*/
public function disableRealContentLink( $link, $atts, $post, $css_class ) {
return 'a' . ( strlen( $css_class ) > 0 ? ' class="' . esc_attr( $css_class ) . '"' : '' );
}
/**
* Used for filter: vc_gitem_zone_image_block_link
* @since 4.5
*
* @param $link
*
* @return string
*/
public function disableGitemZoneLink( $link ) {
return '';
}
public function enqueue() {
visual_composer()->frontCss();
visual_composer()->frontJsRegister();
wp_enqueue_script( 'prettyphoto' );
wp_enqueue_style( 'prettyphoto' );
wp_enqueue_style( 'js_composer_front' );
wp_enqueue_script( 'wpb_composer_front_js' );
wp_enqueue_style( 'js_composer_custom_css' );
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_VC_Basic_Grid' );
$grid = new WPBakeryShortCode_VC_Basic_Grid( array( 'base' => 'vc_basic_grid' ) );
$grid->shortcodeScripts();
$grid->enqueueScripts();
}
public function mockingPost() {
$post = get_post( $this->post_id );
setup_postdata( $post );
$post->post_title = __( 'Post title', 'js_composer' );
$post->post_content = __( 'The WordPress Excerpt is an optional summary or description of a post; in short, a post summary.', 'js_composer' );
$post->post_excerpt = __( 'The WordPress Excerpt is an optional summary or description of a post; in short, a post summary.', 'js_composer' );
add_filter( 'get_the_categories', array(
$this,
'getTheCategories',
), 10, 2 );
$GLOBALS['post'] = $post;
return $post;
}
public function getTheCategories( $categories, $post_id ) {
$ret = $categories;
if ( ! $post_id || ( $post_id && $post_id == $this->post_id ) ) {
$cat = get_categories( 'number=5' );
if ( empty( $ret ) && ! empty( $cat ) ) {
$ret += $cat;
}
}
return $ret;
}
public function addPlaceholderImage( $img ) {
if ( null === $img || false === $img ) {
$img = array(
'thumbnail' => '<img class="vc_img-placeholder vc_single_image-img" src="' . vc_asset_url( 'vc/vc_gitem_image.png' ) . '" />',
);
}
return $img;
}
}
@@ -0,0 +1,82 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'EDITORS_DIR', 'navbar/class-vc-navbar.php' );
/**
* Renders navigation bar for Editors.
*/
class Vc_Navbar_Grid_Item extends Vc_Navbar {
protected $controls = array(
'templates',
'save_backend',
'preview_template',
'animation_list',
'preview_item_width',
'edit',
);
/**
* @return string
*/
public function getControlTemplates() {
return '<li><a href="javascript:;" class="vc_icon-btn vc_templates-button" id="vc_templates-editor-button" title="'
. __( 'Templates', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-add_template"></i></a></li>';
}
public function getControlPreviewTemplate() {
return '<li class="vc_pull-right">'
. '<a href="#" class="vc_btn vc_btn-grey vc_btn-sm vc_navbar-btn" data-vc-navbar-control="preview">' . __( 'Preview', 'js_composer' ) . '</a>'
. '</li>';
}
public function getControlEdit() {
return '<li class="vc_pull-right">'
. '<a data-vc-navbar-control="edit" class="vc_icon-btn vc_post-settings" title="'
. __( 'Grid element settings', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-cog"></i>'
. '</a>'
. '</li>';
}
/**
* @return string
*/
public function getControlSaveBackend() {
return '<li class="vc_pull-right vc_save-backend">'
. '<a class="vc_btn vc_btn-sm vc_navbar-btn vc_btn-primary vc_control-save" id="wpb-save-post">' . __( 'Update', 'js_composer' ) . '</a>'
. '</li>';
}
/**
* @return string
*/
public function getControlPreviewItemWidth() {
$output = '<li class="vc_pull-right vc_gitem-navbar-dropdown vc_gitem-navbar-preview-width" data-vc-grid-item="navbar_preview_width"><select data-vc-navbar-control="preview_width">';
for ( $i = 1; $i <= 12; $i ++ ) {
$output .= '<option value="' . esc_attr( $i ) . '">' . sprintf( __( '%s/12 width', 'js_composer' ), $i ) . '</option>';
}
$output .= '</select></li>';
return $output;
}
public function getControlAnimationList() {
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_VC_Gitem_Animated_Block' );
$output = '';
$animations = WPBakeryShortCode_VC_Gitem_Animated_Block::animations();
if ( is_array( $animations ) ) {
$output .= '<li class="vc_pull-right vc_gitem-navbar-dropdown">'
. '<select data-vc-navbar-control="animation">';
foreach ( $animations as $value => $key ) {
$output .= '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
}
$output .= '</select></li>';
}
return $output;
}
}
@@ -0,0 +1,36 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'EDITORS_DIR', 'popups/class-vc-add-element-box.php' );
/**
* Add element for VC editors with a list of mapped shortcodes for gri item constructor.
*
* @since 4.4
*/
class Vc_Add_Element_Box_Grid_Item extends Vc_Add_Element_Box {
/**
* Get shortcodes from param type vc_grid_item
* @return array|bool
*/
public function shortcodes() {
return WpbMap_Grid_Item::getSortedGitemUserShortCodes();
}
/**
* Get categories list from mapping data.
* @since 4.5
*
* @return array
*/
public function getCategories() {
return WpbMap_Grid_Item::getGitemUserCategories();
}
public function getPartState() {
return vc_user_access()->part( 'grid_builder' )->getState();
}
}
@@ -0,0 +1,205 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'EDITORS_DIR', 'popups/class-vc-templates-panel-editor.php' );
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php' );
class Vc_Templates_Editor_Grid_Item extends Vc_Templates_Panel_Editor {
protected $vc_grid_item_param;
protected $default_templates = array(); // this prevents for loading default templates
public function __construct() {
add_filter( 'vc_templates_render_category', array(
$this,
'renderTemplateBlock',
), 10, 2 );
add_filter( 'vc_templates_render_template', array(
$this,
'renderTemplateWindowGrid',
), 10, 2 );
}
public function renderTemplateBlock( $category ) {
if ( 'grid_templates' === $category['category'] || 'grid_templates_custom' === $category['category'] ) {
$category['output'] = '<div class="vc_col-md-12">';
if ( isset( $category['category_name'] ) ) {
$category['output'] .= '<h3>' . esc_html( $category['category_name'] ) . '</h3>';
}
if ( isset( $category['category_description'] ) ) {
$category['output'] .= '<p class="vc_description">' . esc_html( $category['category_description'] ) . '</p>';
}
$category['output'] .= '</div>';
$category['output'] .= '
<div class="vc_column vc_col-sm-12">
<div class="vc_ui-template-list vc_templates-list-my_templates vc_ui-list-bar" data-vc-action="collapseAll">';
if ( ! empty( $category['templates'] ) ) {
foreach ( $category['templates'] as $template ) {
$category['output'] .= $this->renderTemplateListItem( $template );
}
}
$category['output'] .= '
</div>
</div>';
}
return $category;
}
/** Output rendered template in modal dialog
* @since 4.4
*
* @param $template_name
* @param $template_data
*
* @return string
*/
public function renderTemplateWindowGrid( $template_name, $template_data ) {
if ( 'grid_templates' === $template_data['type'] || 'grid_templates_custom' === $template_data['type'] ) {
return $this->renderTemplateWindowGridTemplate( $template_name, $template_data );
}
return $template_name;
}
/**
* @since 4.4
*
* @param $templateName
* @param $templateData
*
* @return string
*/
protected function renderTemplateWindowGridTemplate( $templateName, $templateData ) {
ob_start();
$templateId = esc_attr( $templateData['unique_id'] );
$templateName = esc_html( $templateName );
$templateNameLower = strtolower( $templateName );
$templateType = esc_attr( isset( $templateData['type'] ) ? $templateData['type'] : 'custom' );
$customClass = esc_attr( isset( $templateData['custom_class'] ) ? $templateData['custom_class'] : '' );
$previewTemplateTitle = esc_attr__( 'Preview template', 'js_composer' );
$addTemplateTitle = esc_attr__( 'Preview template', 'js_composer' );
echo <<<HTML
<button type="button" class="vc_ui-list-bar-item-trigger" title="$addTemplateTitle"
data-template-handler=""
data-vc-ui-element="template-title">$templateName</button>
<div class="vc_ui-list-bar-item-actions">
<button type="button" class="vc_general vc_ui-control-button" title="$addTemplateTitle"
data-template-handler=""
data-vc-ui-element="template-title">
<i class="vc-composer-icon vc-c-icon-add"></i>
</button>
<button type="button" class="vc_general vc_ui-control-button" title="$previewTemplateTitle"
data-vc-preview-handler data-vc-container=".vc_ui-list-bar" data-vc-target="[data-template_id=$templateId]">
<i class="vc-composer-icon vc-c-icon-arrow_drop_down"></i>
</button>
</div>
HTML;
return ob_get_clean();
}
public function load( $template_id = false ) {
if ( ! $template_id ) {
$template_id = vc_post_param( 'template_unique_id' );
}
if ( ! isset( $template_id ) || '' === $template_id ) {
echo 'Error: TPL-02';
die();
}
if ( false !== ( $predefined_template = Vc_Grid_Item::predefinedTemplate( $template_id ) ) ) {
echo trim( $predefined_template['template'] );
}
}
public function loadCustomTemplate( $template_id = false ) {
if ( ! $template_id ) {
$template_id = vc_post_param( 'template_unique_id' );
}
if ( ! isset( $template_id ) || '' === $template_id ) {
echo 'Error: TPL-02';
die();
}
$post = get_post( $template_id );
if ( $post && Vc_Grid_Item_Editor::postType() == $post->post_type ) {
return $post->post_content;
}
return '';
}
public function getAllTemplates() {
$data = array();
$grid_templates = $this->getGridTemplates();
// this has only 'name' and 'template' key and index 'key' is template id.
if ( ! empty( $grid_templates ) ) {
$arr_category = array(
'category' => 'grid_templates',
'category_name' => __( 'Grid Templates', 'js_composer' ),
'category_weight' => 10,
);
$category_templates = array();
foreach ( $grid_templates as $template_id => $template_data ) {
$category_templates[] = array(
'unique_id' => $template_id,
'name' => $template_data['name'],
'type' => 'grid_templates',
// for rendering in backend/frontend with ajax
);
}
$arr_category['templates'] = $category_templates;
$data[] = $arr_category;
}
$custom_grid_templates = $this->getCustomTemplateList();
if ( ! empty( $custom_grid_templates ) ) {
$arr_category = array(
'category' => 'grid_templates_custom',
'category_name' => __( 'Custom Grid Templates', 'js_composer' ),
'category_weight' => 10,
);
$category_templates = array();
foreach ( $custom_grid_templates as $template_name => $template_id ) {
$category_templates[] = array(
'unique_id' => $template_id,
'name' => $template_name,
'type' => 'grid_templates_custom',
// for rendering in backend/frontend with ajax);
);
}
$arr_category['templates'] = $category_templates;
$data[] = $arr_category;
}
// To get any other 3rd "Custom template" - do this by hook filter 'vc_get_all_templates'
return apply_filters( 'vc_grid_get_all_templates', $data );
}
protected function getCustomTemplateList() {
$list = array();
$templates = get_posts( array(
'post_type' => Vc_Grid_Item_Editor::postType(),
'numberposts' => - 1,
) );
foreach ( $templates as $template ) {
$id = $template->ID;
$list[ $template->post_title ] = $id;
}
return $list;
}
public function getGridTemplates() {
$list = Vc_Grid_Item::predefinedTemplates();
return $list;
}
}
@@ -0,0 +1,899 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_VC_Gitem_Animated_Block' );
global $vc_gitem_add_link_param;
$vc_gitem_add_link_param = apply_filters( 'vc_gitem_add_link_param', array(
'type' => 'dropdown',
'heading' => __( 'Add link', 'js_composer' ),
'param_name' => 'link',
'value' => array(
__( 'None', 'js_composer' ) => 'none',
__( 'Post link', 'js_composer' ) => 'post_link',
__( 'Post author', 'js_composer' ) => 'post_author',
__( 'Large image', 'js_composer' ) => 'image',
__( 'Large image (prettyPhoto)', 'js_composer' ) => 'image_lightbox',
__( 'Custom', 'js_composer' ) => 'custom',
),
'description' => __( 'Select link option.', 'js_composer' ),
) );
$zone_params = array(
$vc_gitem_add_link_param,
array(
'type' => 'vc_link',
'heading' => __( 'URL (Link)', 'js_composer' ),
'param_name' => 'url',
'dependency' => array(
'element' => 'link',
'value' => array( 'custom' ),
),
'description' => __( 'Add custom link.', 'js_composer' ),
),
array(
'type' => 'checkbox',
'heading' => __( 'Use featured image on background?', 'js_composer' ),
'param_name' => 'featured_image',
'value' => array( __( 'Yes', 'js_composer' ) => 'yes' ),
'description' => __( 'Note: Featured image overwrites background image and color from "Design Options".', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => __( 'Image size', 'js_composer' ),
'param_name' => 'img_size',
'value' => 'large',
'description' => __( 'Enter image size (Example: "thumbnail", "medium", "large", "full" or other sizes defined by theme). Alternatively enter size in pixels (Example: 200x100 (Width x Height)).', 'js_composer' ),
'dependency' => array(
'element' => 'featured_image',
'not_empty' => true,
),
),
array(
'type' => 'css_editor',
'heading' => __( 'CSS box', 'js_composer' ),
'param_name' => 'css',
'group' => __( 'Design Options', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => __( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
);
$post_data_params = array(
$vc_gitem_add_link_param,
array(
'type' => 'vc_link',
'heading' => __( 'URL (Link)', 'js_composer' ),
'param_name' => 'url',
'dependency' => array(
'element' => 'link',
'value' => array( 'custom' ),
),
'description' => __( 'Add custom link.', 'js_composer' ),
),
array(
'type' => 'css_editor',
'heading' => __( 'CSS box', 'js_composer' ),
'param_name' => 'css',
'group' => __( 'Design Options', 'js_composer' ),
),
);
$custom_fonts_params = array(
array(
'type' => 'font_container',
'param_name' => 'font_container',
'value' => '',
'settings' => array(
'fields' => array(
'tag' => 'div', // default value h2
'text_align',
'tag_description' => __( 'Select element tag.', 'js_composer' ),
'text_align_description' => __( 'Select text alignment.', 'js_composer' ),
'font_size_description' => __( 'Enter font size.', 'js_composer' ),
'line_height_description' => __( 'Enter line height.', 'js_composer' ),
'color_description' => __( 'Select color for your element.', 'js_composer' ),
),
),
),
array(
'type' => 'checkbox',
'heading' => __( 'Use custom fonts?', 'js_composer' ),
'param_name' => 'use_custom_fonts',
'value' => array( __( 'Yes', 'js_composer' ) => 'yes' ),
'description' => __( 'Enable Google fonts.', 'js_composer' ),
),
array(
'type' => 'font_container',
'param_name' => 'block_container',
'value' => '',
'settings' => array(
'fields' => array(
'font_size',
'line_height',
'color',
'tag_description' => __( 'Select element tag.', 'js_composer' ),
'text_align_description' => __( 'Select text alignment.', 'js_composer' ),
'font_size_description' => __( 'Enter font size.', 'js_composer' ),
'line_height_description' => __( 'Enter line height.', 'js_composer' ),
'color_description' => __( 'Select color for your element.', 'js_composer' ),
),
),
'group' => __( 'Custom fonts', 'js_composer' ),
'dependency' => array(
'element' => 'use_custom_fonts',
'value' => array( 'yes' ),
),
),
array(
'type' => 'checkbox',
'heading' => __( 'Yes theme default font family?', 'js_composer' ),
'param_name' => 'use_theme_fonts',
'value' => array( __( 'Yes', 'js_composer' ) => 'yes' ),
'description' => __( 'Yes font family from the theme.', 'js_composer' ),
'group' => __( 'Custom fonts', 'js_composer' ),
'dependency' => array(
'element' => 'use_custom_fonts',
'value' => array( 'yes' ),
),
),
array(
'type' => 'google_fonts',
'param_name' => 'google_fonts',
'value' => '',
// Not recommended, this will override 'settings'. 'font_family:'.rawurlencode('Exo:100,100italic,200,200italic,300,300italic,regular,italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic').'|font_style:'.rawurlencode('900 bold italic:900:italic'),
'settings' => array(
'fields' => array(
// Default font style. Name:weight:style, example: "800 bold regular:800:normal"
'font_family_description' => __( 'Select font family.', 'js_composer' ),
'font_style_description' => __( 'Select font styling.', 'js_composer' ),
),
),
'group' => __( 'Custom fonts', 'js_composer' ),
'dependency' => array(
'element' => 'use_theme_fonts',
'value_not_equal_to' => 'yes',
),
),
);
$list = array(
'vc_gitem' => array(
'name' => __( 'Grid Item', 'js_composer' ),
'base' => 'vc_gitem',
'is_container' => true,
'icon' => 'icon-wpb-gitem',
'content_element' => false,
'show_settings_on_create' => false,
'category' => __( 'Content', 'js_composer' ),
'description' => __( 'Main grid item', 'js_composer' ),
'params' => array(
array(
'type' => 'css_editor',
'heading' => __( 'CSS box', 'js_composer' ),
'param_name' => 'css',
),
array(
'type' => 'textfield',
'heading' => __( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
),
'js_view' => 'VcGitemView',
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_animated_block' => array(
'base' => 'vc_gitem_animated_block',
'name' => __( 'A/B block', 'js_composer' ),
'content_element' => false,
'is_container' => true,
'show_settings_on_create' => false,
'icon' => 'icon-wpb-gitem-block',
'category' => __( 'Content', 'js_composer' ),
'controls' => array(),
'as_parent' => array( 'only' => array( 'vc_gitem_zone_a', 'vc_gitem_zone_b' ) ),
'params' => array(
array(
'type' => 'dropdown',
'heading' => __( 'Animation', 'js_composer' ),
'param_name' => 'animation',
'value' => WPBakeryShortCode_VC_Gitem_Animated_Block::animations(),
),
),
'js_view' => 'VcGitemAnimatedBlockView',
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_zone' => array(
'name' => __( 'Zone', 'js_composer' ),
'base' => 'vc_gitem_zone',
'content_element' => false,
'is_container' => true,
'show_settings_on_create' => false,
'icon' => 'icon-wpb-gitem-zone',
'category' => __( 'Content', 'js_composer' ),
'controls' => array( 'edit' ),
'as_parent' => array( 'only' => 'vc_gitem_row' ),
'js_view' => 'VcGitemZoneView',
'params' => $zone_params,
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_zone_a' => array(
'name' => __( 'Normal', 'js_composer' ),
'base' => 'vc_gitem_zone_a',
'content_element' => false,
'is_container' => true,
'show_settings_on_create' => false,
'icon' => 'icon-wpb-gitem-zone',
'category' => __( 'Content', 'js_composer' ),
'controls' => array( 'edit' ),
'as_parent' => array( 'only' => 'vc_gitem_row' ),
'js_view' => 'VcGitemZoneView',
'params' => array_merge( array(
array(
'type' => 'dropdown',
'heading' => __( 'Height mode', 'js_composer' ),
'param_name' => 'height_mode',
'value' => array(
'1:1' => '1-1',
__( 'Original', 'js_composer' ) => 'original',
'4:3' => '4-3',
'3:4' => '3-4',
'16:9' => '16-9',
'9:16' => '9-16',
__( 'Custom', 'js_composer' ) => 'custom',
),
'description' => __( 'Sizing proportions for height and width. Select "Original" to scale image without cropping.', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => __( 'Height', 'js_composer' ),
'param_name' => 'height',
'dependency' => array(
'element' => 'height_mode',
'value' => array( 'custom' ),
),
'description' => __( 'Enter custom height.', 'js_composer' ),
),
), $zone_params ),
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_zone_b' => array(
'name' => __( 'Hover', 'js_composer' ),
'base' => 'vc_gitem_zone_b',
'content_element' => false,
'is_container' => true,
'show_settings_on_create' => false,
'icon' => 'icon-wpb-gitem-zone',
'category' => __( 'Content', 'js_composer' ),
'controls' => array( 'edit' ),
'as_parent' => array( 'only' => 'vc_gitem_row' ),
'js_view' => 'VcGitemZoneView',
'params' => $zone_params,
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_zone_c' => array(
'name' => __( 'Additional', 'js_composer' ),
'base' => 'vc_gitem_zone_c',
'content_element' => false,
'is_container' => true,
'show_settings_on_create' => false,
'icon' => 'icon-wpb-gitem-zone',
'category' => __( 'Content', 'js_composer' ),
'controls' => array( 'move', 'delete', 'edit' ),
'as_parent' => array( 'only' => 'vc_gitem_row' ),
'js_view' => 'VcGitemZoneCView',
'params' => array(
array(
'type' => 'css_editor',
'heading' => __( 'CSS box', 'js_composer' ),
'param_name' => 'css',
),
array(
'type' => 'textfield',
'heading' => __( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
),
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_row' => array(
'name' => __( 'Row', 'js_composer' ),
'base' => 'vc_gitem_row',
'content_element' => false,
'is_container' => true,
'icon' => 'icon-wpb-row',
'weight' => 1000,
'show_settings_on_create' => false,
'controls' => array( 'layout', 'delete' ),
'allowed_container_element' => 'vc_gitem_col',
'category' => __( 'Content', 'js_composer' ),
'description' => __( 'Place content elements inside the row', 'js_composer' ),
'params' => array(
array(
'type' => 'textfield',
'heading' => __( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
),
'js_view' => 'VcGitemRowView',
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_col' => array(
'name' => __( 'Column', 'js_composer' ),
'base' => 'vc_gitem_col',
'icon' => 'icon-wpb-row',
'weight' => 1000,
'is_container' => true,
'allowed_container_element' => false,
'content_element' => false,
'controls' => array( 'edit' ),
'description' => __( 'Place content elements inside the column', 'js_composer' ),
'params' => array(
array(
'type' => 'dropdown',
'heading' => __( 'Width', 'js_composer' ),
'param_name' => 'width',
'value' => array(
__( '1 column - 1/12', 'js_composer' ) => '1/12',
__( '2 columns - 1/6', 'js_composer' ) => '1/6',
__( '3 columns - 1/4', 'js_composer' ) => '1/4',
__( '4 columns - 1/3', 'js_composer' ) => '1/3',
__( '5 columns - 5/12', 'js_composer' ) => '5/12',
__( '6 columns - 1/2', 'js_composer' ) => '1/2',
__( '7 columns - 7/12', 'js_composer' ) => '7/12',
__( '8 columns - 2/3', 'js_composer' ) => '2/3',
__( '9 columns - 3/4', 'js_composer' ) => '3/4',
__( '10 columns - 5/6', 'js_composer' ) => '5/6',
__( '11 columns - 11/12', 'js_composer' ) => '11/12',
__( '12 columns - 1/1', 'js_composer' ) => '1/1',
),
'description' => __( 'Select column width.', 'js_composer' ),
'std' => '1/1',
),
array(
'type' => 'checkbox',
'heading' => __( 'Use featured image on background?', 'js_composer' ),
'param_name' => 'featured_image',
'value' => array( __( 'Yes', 'js_composer' ) => 'yes' ),
'description' => __( 'Note: Featured image overwrites background image and color from "Design Options".', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => __( 'Image size', 'js_composer' ),
'param_name' => 'img_size',
'value' => 'large',
'description' => __( 'Enter image size (Example: "thumbnail", "medium", "large", "full" or other sizes defined by theme). Alternatively enter size in pixels (Example: 200x100 (Width x Height)).', 'js_composer' ),
'dependency' => array(
'element' => 'featured_image',
'not_empty' => true,
),
),
array(
'type' => 'css_editor',
'heading' => __( 'CSS box', 'js_composer' ),
'param_name' => 'css',
'group' => __( 'Design Options', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => __( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
),
'js_view' => 'VcGitemColView',
'post_type' => Vc_Grid_Item_Editor::postType(),
),
/*'vc_gitem_post_data' => array(
'name' => __( 'Post data', 'js_composer' ),
'base' => 'vc_gitem_post_data',
'content_element' => false,
'category' => __( 'Post', 'js_composer' ),
'params' => array_merge( array(
array(
'type' => 'textfield',
'heading' => __( 'Post data source', 'js_composer' ),
'param_name' => 'data_source',
'value' => 'ID',
)
), $post_data_params, $custom_fonts_params, array(
array(
'type' => 'textfield',
'heading' => __( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
) ),
'post_type' => Vc_Grid_Item_Editor::postType(),
),*/
'vc_gitem_post_title' => array(
'name' => __( 'Post Title', 'js_composer' ),
'base' => 'vc_gitem_post_title',
'icon' => 'vc_icon-vc-gitem-post-title',
'category' => __( 'Post', 'js_composer' ),
'description' => __( 'Title of current post', 'js_composer' ),
'params' => array_merge( $post_data_params, $custom_fonts_params, array(
array(
'type' => 'textfield',
'heading' => __( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
) ),
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_post_excerpt' => array(
'name' => __( 'Post Excerpt', 'js_composer' ),
'base' => 'vc_gitem_post_excerpt',
'icon' => 'vc_icon-vc-gitem-post-excerpt',
'category' => __( 'Post', 'js_composer' ),
'description' => __( 'Excerpt or manual excerpt', 'js_composer' ),
'params' => array_merge( $post_data_params, $custom_fonts_params, array(
array(
'type' => 'textfield',
'heading' => __( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
) ),
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_post_author' => array(
'name' => __( 'Post Author', 'js_composer' ),
'base' => 'vc_gitem_post_author',
'icon' => 'vc_icon-vc-gitem-post-author', // @todo change icon ?
'category' => __( 'Post', 'js_composer' ),
'description' => __( 'Author of current post', 'js_composer' ),
'params' => array_merge( array(
array(
'type' => 'checkbox',
'heading' => __( 'Add link', 'js_composer' ),
'param_name' => 'link',
'value' => '',
'description' => __( 'Add link to author?', 'js_composer' ),
),
array(
'type' => 'css_editor',
'heading' => __( 'CSS box', 'js_composer' ),
'param_name' => 'css',
'group' => __( 'Design Options', 'js_composer' ),
),
), $custom_fonts_params, array(
array(
'type' => 'textfield',
'heading' => __( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
) ),
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_post_categories' => array(
'name' => __( 'Post Categories', 'js_composer' ),
'base' => 'vc_gitem_post_categories',
'icon' => 'vc_icon-vc-gitem-post-categories', // @todo change icon ?
'category' => __( 'Post', 'js_composer' ),
'description' => __( 'Categories of current post', 'js_composer' ),
'params' => array(
array(
'type' => 'checkbox',
'heading' => __( 'Add link', 'js_composer' ),
'param_name' => 'link',
'value' => '',
'description' => __( 'Add link to category?', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Style', 'js_composer' ),
'param_name' => 'category_style',
'value' => array(
__( 'None', 'js_composer' ) => ' ',
__( 'Comma', 'js_composer' ) => ', ',
__( 'Rounded', 'js_composer' ) => 'filled vc_grid-filter-filled-round-all',
__( 'Less Rounded', 'js_composer' ) => 'filled vc_grid-filter-filled-rounded-all',
__( 'Border', 'js_composer' ) => 'bordered',
__( 'Rounded Border', 'js_composer' ) => 'bordered-rounded vc_grid-filter-filled-round-all',
__( 'Less Rounded Border', 'js_composer' ) => 'bordered-rounded-less vc_grid-filter-filled-rounded-all',
),
'description' => __( 'Select category display style.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Color', 'js_composer' ),
'param_name' => 'category_color',
'value' => getVcShared( 'colors' ),
'std' => 'grey',
'param_holder_class' => 'vc_colored-dropdown',
'dependency' => array(
'element' => 'category_style',
'value_not_equal_to' => array( ' ', ', ' ),
),
'description' => __( 'Select category color.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Category size', 'js_composer' ),
'param_name' => 'category_size',
'value' => getVcShared( 'sizes' ),
'std' => 'md',
'description' => __( 'Select category size.', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => __( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
array(
'type' => 'css_editor',
'heading' => __( 'CSS box', 'js_composer' ),
'param_name' => 'css',
'group' => __( 'Design Options', 'js_composer' ),
),
),
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_image' => array(
'name' => __( 'Post Image', 'js_composer' ),
'base' => 'vc_gitem_image',
'icon' => 'vc_icon-vc-gitem-image',
'category' => __( 'Post', 'js_composer' ),
'description' => __( 'Featured image', 'js_composer' ),
'params' => array(
$vc_gitem_add_link_param,
array(
'type' => 'vc_link',
'heading' => __( 'URL (Link)', 'js_composer' ),
'param_name' => 'url',
'dependency' => array(
'element' => 'link',
'value' => array( 'custom' ),
),
'description' => __( 'Add custom link.', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => __( 'Image size', 'js_composer' ),
'param_name' => 'img_size',
'description' => __( 'Enter image size (Example: "thumbnail", "medium", "large", "full" or other sizes defined by theme). Alternatively enter size in pixels (Example: 200x100 (Width x Height)). Leave parameter empty to use "thumbnail" by default.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Image alignment', 'js_composer' ),
'param_name' => 'alignment',
'value' => array(
__( 'Left', 'js_composer' ) => '',
__( 'Right', 'js_composer' ) => 'right',
__( 'Center', 'js_composer' ) => 'center',
),
'description' => __( 'Select image alignment.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Image style', 'js_composer' ),
'param_name' => 'style',
'value' => getVcShared( 'single image styles' ),
'description' => __( 'Select image display style.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Border color', 'js_composer' ),
'param_name' => 'border_color',
'value' => getVcShared( 'colors' ),
'std' => 'grey',
'dependency' => array(
'element' => 'style',
'value' => array(
'vc_box_border',
'vc_box_border_circle',
'vc_box_outline',
'vc_box_outline_circle',
),
),
'description' => __( 'Border color.', 'js_composer' ),
'param_holder_class' => 'vc_colored-dropdown',
),
vc_map_add_css_animation(),
array(
'type' => 'textfield',
'heading' => __( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
array(
'type' => 'css_editor',
'heading' => __( 'CSS box', 'js_composer' ),
'param_name' => 'css',
'group' => __( 'Design Options', 'js_composer' ),
),
),
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_post_date' => array(
'name' => __( 'Post Date', 'js_composer' ),
'base' => 'vc_gitem_post_date',
'icon' => 'vc_icon-vc-gitem-post-date',
'category' => __( 'Post', 'js_composer' ),
'description' => __( 'Post publish date', 'js_composer' ),
'params' => array_merge( $post_data_params, $custom_fonts_params, array(
array(
'type' => 'textfield',
'heading' => __( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
) ),
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_post_meta' => array(
'name' => __( 'Custom Field', 'js_composer' ),
'base' => 'vc_gitem_post_meta',
'icon' => 'vc_icon-vc-gitem-post-meta',
'category' => array(
__( 'Elements', 'js_composer' )
),
'description' => __( 'Custom fields data from meta values of the post.', 'js_composer' ),
'params' => array(
array(
'type' => 'textfield',
'heading' => __( 'Field key name', 'js_composer' ),
'param_name' => 'key',
'description' => __( 'Enter custom field name to retrieve meta data value.', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => __( 'Label', 'js_composer' ),
'param_name' => 'label',
'description' => __( 'Enter label to display before key value.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Alignment', 'js_composer' ),
'param_name' => 'align',
'value' => array(
__( 'Left', 'js_composer' ) => 'left',
__( 'Right', 'js_composer' ) => 'right',
__( 'Center', 'js_composer' ) => 'center',
__( 'Justify', 'js_composer' ) => 'justify',
),
'description' => __( 'Select alignment.', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => __( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
),
'post_type' => Vc_Grid_Item_Editor::postType(),
),
);
$shortcode_vc_column_text = WPBMap::getShortCode( 'vc_column_text' );
if ( is_array( $shortcode_vc_column_text ) && isset( $shortcode_vc_column_text['base'] ) ) {
$list['vc_column_text'] = $shortcode_vc_column_text;
$list['vc_column_text']['post_type'] = Vc_Grid_Item_Editor::postType();
$remove = array( 'el_id' );
foreach ( $list['vc_column_text']['params'] as $k => $v ) {
if ( in_array( $v['param_name'], $remove ) ) {
unset( $list['vc_column_text']['params'][ $k ] );
}
}
}
$shortcode_vc_separator = WPBMap::getShortCode( 'vc_separator' );
if ( is_array( $shortcode_vc_separator ) && isset( $shortcode_vc_separator['base'] ) ) {
$list['vc_separator'] = $shortcode_vc_separator;
$list['vc_separator']['post_type'] = Vc_Grid_Item_Editor::postType();
$remove = array( 'el_id' );
foreach ( $list['vc_separator']['params'] as $k => $v ) {
if ( in_array( $v['param_name'], $remove ) ) {
unset( $list['vc_separator']['params'][ $k ] );
}
}
}
$shortcode_vc_text_separator = WPBMap::getShortCode( 'vc_text_separator' );
if ( is_array( $shortcode_vc_text_separator ) && isset( $shortcode_vc_text_separator['base'] ) ) {
$list['vc_text_separator'] = $shortcode_vc_text_separator;
$list['vc_text_separator']['post_type'] = Vc_Grid_Item_Editor::postType();
$remove = array( 'el_id' );
foreach ( $list['vc_text_separator']['params'] as $k => $v ) {
if ( in_array( $v['param_name'], $remove ) ) {
unset( $list['vc_text_separator']['params'][ $k ] );
}
}
}
$shortcode_vc_icon = WPBMap::getShortCode( 'vc_icon' );
if ( is_array( $shortcode_vc_icon ) && isset( $shortcode_vc_icon['base'] ) ) {
$list['vc_icon'] = $shortcode_vc_icon;
$list['vc_icon']['post_type'] = Vc_Grid_Item_Editor::postType();
$list['vc_icon']['params'] = vc_map_integrate_shortcode( 'vc_icon', '', '', array( 'exclude' => array( 'link', 'el_id' ) ) );
}
$list['vc_single_image'] = array(
'name' => __( 'Single Image', 'js_composer' ),
'base' => 'vc_single_image',
'icon' => 'icon-wpb-single-image',
'category' => __( 'Content', 'js_composer' ),
'description' => __( 'Simple image with CSS animation', 'js_composer' ),
'params' => array(
array(
'type' => 'textfield',
'heading' => __( 'Widget title', 'js_composer' ),
'param_name' => 'title',
'description' => __( 'Enter text used as widget title (Note: located above content element).', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Image source', 'js_composer' ),
'param_name' => 'source',
'value' => array(
__( 'Media library', 'js_composer' ) => 'media_library',
__( 'External link', 'js_composer' ) => 'external_link',
),
'std' => 'media_library',
'description' => __( 'Select image source.', 'js_composer' ),
),
array(
'type' => 'attach_image',
'heading' => __( 'Image', 'js_composer' ),
'param_name' => 'image',
'value' => '',
'description' => __( 'Select image from media library.', 'js_composer' ),
'dependency' => array(
'element' => 'source',
'value' => 'media_library',
),
),
array(
'type' => 'textfield',
'heading' => __( 'External link', 'js_composer' ),
'param_name' => 'custom_src',
'description' => __( 'Select external link.', 'js_composer' ),
'dependency' => array(
'element' => 'source',
'value' => 'external_link',
),
),
vc_map_add_css_animation(),
array(
'type' => 'textfield',
'heading' => __( 'Image size', 'js_composer' ),
'param_name' => 'img_size',
'description' => __( 'Enter image size (Example: "thumbnail", "medium", "large", "full" or other sizes defined by theme). Alternatively enter size in pixels (Example: 200x100 (Width x Height)). Leave parameter empty to use "thumbnail" by default.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Image alignment', 'js_composer' ),
'param_name' => 'alignment',
'value' => array(
__( 'Left', 'js_composer' ) => '',
__( 'Right', 'js_composer' ) => 'right',
__( 'Center', 'js_composer' ) => 'center',
),
'description' => __( 'Select image alignment.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Image style', 'js_composer' ),
'param_name' => 'style',
'value' => getVcShared( 'single image styles' ),
'description' => __( 'Select image display style.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Border color', 'js_composer' ),
'param_name' => 'border_color',
'value' => getVcShared( 'colors' ),
'std' => 'grey',
'dependency' => array(
'element' => 'style',
'value' => array( 'vc_box_border', 'vc_box_border_circle', 'vc_box_outline', 'vc_box_outline_circle' ),
),
'description' => __( 'Border color.', 'js_composer' ),
'param_holder_class' => 'vc_colored-dropdown',
),
array(
'type' => 'textfield',
'heading' => __( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
array(
'type' => 'css_editor',
'heading' => __( 'CSS box', 'js_composer' ),
'param_name' => 'css',
'group' => __( 'Design Options', 'js_composer' ),
),
),
'post_type' => Vc_Grid_Item_Editor::postType(),
);
$shortcode_vc_button2 = WPBMap::getShortCode( 'vc_button2' );
if ( is_array( $shortcode_vc_button2 ) && isset( $shortcode_vc_button2['base'] ) ) {
$list['vc_button2'] = $shortcode_vc_button2;
$list['vc_button2']['post_type'] = Vc_Grid_Item_Editor::postType();
}
$shortcode_vc_btn = WPBMap::getShortCode( 'vc_btn' );
if ( is_array( $shortcode_vc_btn ) && isset( $shortcode_vc_btn['base'] ) ) {
$list['vc_btn'] = $shortcode_vc_btn;
$list['vc_btn']['post_type'] = Vc_Grid_Item_Editor::postType();
unset( $list['vc_btn']['params'][1] );
$remove = array( 'el_id' );
foreach ( $list['vc_btn']['params'] as $k => $v ) {
if ( in_array( $v['param_name'], $remove ) ) {
unset( $list['vc_btn']['params'][ $k ] );
}
}
}
$shortcode_vc_custom_heading = WPBMap::getShortCode( 'vc_custom_heading' );
if ( is_array( $shortcode_vc_custom_heading ) && isset( $shortcode_vc_custom_heading['base'] ) ) {
$list['vc_custom_heading'] = $shortcode_vc_custom_heading;
$list['vc_custom_heading']['post_type'] = Vc_Grid_Item_Editor::postType();
$remove = array( 'link', 'source', 'el_id' );
foreach ( $list['vc_custom_heading']['params'] as $k => $v ) {
if ( in_array( $v['param_name'], $remove ) ) {
unset( $list['vc_custom_heading']['params'][ $k ] );
}
// text depends on source. remove dependency so text is always saved
if ( 'text' === $v['param_name'] ) {
unset( $list['vc_custom_heading']['params'][ $k ]['dependency'] );
}
}
}
$shortcode_vc_empty_space = WPBMap::getShortCode( 'vc_empty_space' );
if ( is_array( $shortcode_vc_empty_space ) && isset( $shortcode_vc_empty_space['base'] ) ) {
$list['vc_empty_space'] = $shortcode_vc_empty_space;
$list['vc_empty_space']['post_type'] = Vc_Grid_Item_Editor::postType();
$remove = array( 'el_id' );
foreach ( $list['vc_empty_space']['params'] as $k => $v ) {
if ( in_array( $v['param_name'], $remove ) ) {
unset( $list['vc_empty_space']['params'][ $k ] );
}
}
}
foreach ( array( 'vc_icon', 'vc_button2', 'vc_btn', 'vc_custom_heading', 'vc_single_image' ) as $key ) {
if ( isset( $list[ $key ] ) ) {
if ( ! isset( $list[ $key ]['params'] ) ) {
$list[ $key ]['params'] = array();
}
if ( 'vc_button2' === $key ) {
// change settings for vc_link in dropdown. Add dependency.
$list[ $key ]['params'][0] = array(
'type' => 'vc_link',
'heading' => __( 'URL (Link)', 'js_composer' ),
'param_name' => 'url',
'dependency' => array(
'element' => 'link',
'value' => array( 'custom' ),
),
'description' => __( 'Add custom link.', 'js_composer' ),
);
} else {
array_unshift( $list[ $key ]['params'], array(
'type' => 'vc_link',
'heading' => __( 'URL (Link)', 'js_composer' ),
'param_name' => 'url',
'dependency' => array(
'element' => 'link',
'value' => array( 'custom' ),
),
'description' => __( 'Add custom link.', 'js_composer' ),
) );
}
// Add link dropdown
array_unshift( $list[ $key ]['params'], $vc_gitem_add_link_param );
}
}
foreach ( $list as $key => $value ) {
if ( isset( $list[ $key ]['params'] ) ) {
$list[ $key ]['params'] = array_values( $list[ $key ]['params'] );
}
}
return $list;
@@ -0,0 +1,164 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
return array(
'none' => array(
'name' => __( 'Basic grid: Default', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="bottom"][vc_gitem_animated_block][vc_gitem_zone_a height_mode="1-1" link="post_link" featured_image="yes"][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_zone_c css=".vc_custom_1419240516480{background-color: #f9f9f9 !important;}"][vc_gitem_row][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_btn link="post_link" title="' . __( 'Read more', 'js_composer' ) . '" style="flat" shape="rounded" color="juicy-pink" size="md" align="left"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_c][/vc_gitem]',
),
'basicGrid_ScaleInWithRotation' => array(
'name' => __( 'Basic grid: Scale in with rotation', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="bottom"][vc_gitem_animated_block animation="scaleRotateIn"][vc_gitem_zone_a height_mode="1-1" link="post_link" featured_image="yes"][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 link="post_link" featured_image="" css=".vc_custom_1419240793832{background-color: rgba(0,0,0,0.3) !important;*background-color: rgb(0,0,0) !important;}"][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/1"][/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_zone_c css=".vc_custom_1419240595465{background-color: #f9f9f9 !important;}"][vc_gitem_row][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_btn link="post_link" title="' . __( 'Read more', 'js_composer' ) . '" style="flat" shape="rounded" color="juicy-pink" size="md" align="left"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_c][/vc_gitem]',
),
'basicGrid_FadeInWithSideContent' => array(
'name' => __( 'Basic grid: Fade with side content', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="right" css=".vc_custom_1420541757398{background-color: #f9f9f9 !important;}"][vc_gitem_animated_block animation="fadeIn"][vc_gitem_zone_a height_mode="3-4" link="post_link" featured_image="yes"][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 link="post_link" featured_image="" css=".vc_custom_1419242201096{background-color: rgba(255,255,255,0.2) !important;*background-color: rgb(255,255,255) !important;}"][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_zone_c css=".vc_custom_1419242120132{background-color: #f9f9f9 !important;}"][vc_gitem_row][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_date link="none" font_container="tag:div|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_btn link="post_link" title="' . __( 'Read more', 'js_composer' ) . '" style="flat" shape="rounded" color="juicy-pink" size="md" align="left"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_c][/vc_gitem]',
),
'basicGrid_SlideBottomWithIcon' => array(
'name' => __( 'Basic grid: Slide bottom with icon', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="bottom"][vc_gitem_animated_block animation="slideBottom"][vc_gitem_zone_a height_mode="1-1" link="post_link" featured_image="yes"][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 link="post_link" featured_image="" css=".vc_custom_1419251931135{background-color: rgba(0,0,0,0.3) !important;*background-color: rgb(0,0,0) !important;}"][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/1"][vc_icon type="fontawesome" icon_fontawesome="fa fa-search" icon_openiconic="vc-oi vc-oi-dial" icon_typicons="typcn typcn-zoom" icon_entypo="entypo-icon entypo-icon-note" icon_linecons="vc_li vc_li-heart" color="white" background_color="white" size="md" align="center"][/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_zone_c css=".vc_custom_1419251874438{background-color: #f9f9f9 !important;}"][vc_gitem_row][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_title link="none" font_container="tag:h4|text_align:center" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:center" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_btn link="post_link" title="' . __( 'Read more', 'js_composer' ) . '" style="flat" shape="rounded" color="juicy-pink" size="md" align="center"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_c][/vc_gitem]',
),
'basicGrid_VerticalFlip' => array(
'name' => __( 'Basic grid: Vertical flip', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="" position=""][vc_gitem_animated_block animation="flipFadeIn"][vc_gitem_zone_a height_mode="3-4" link="none" featured_image="yes"][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/1"][/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 link="post_link" featured_image="" css=".vc_custom_1419250758402{background-color: #353535 !important;}"][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/1" featured_image="" css=".vc_custom_1419250916067{padding-right: 15px !important;padding-left: 15px !important;}"][vc_gitem_post_title link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:500%20bold%20regular%3A500%3Anormal" block_container="font_size:22|color:%23ffffff|line_height:1.2"][vc_separator color="white" align="align_center" el_width="50"][vc_gitem_post_excerpt link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:300%20light%20regular%3A300%3Anormal" block_container="font_size:14|color:%23ffffff|line_height:1.3"][/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]',
),
'basicGrid_NoAnimation' => array(
'name' => __( 'Basic grid: No animation', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="none"][vc_gitem_zone_a height_mode="1-1" link="post_link" featured_image="yes"][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 link="post_link" featured_image="" css=".vc_custom_1419253765784{background-color: rgba(0,0,0,0.3) !important;*background-color: rgb(0,0,0) !important;}"][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/1" featured_image=""][vc_gitem_post_date link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:12|color:%23e5e5e5" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_title link="none" font_container="tag:h3|text_align:center" use_custom_fonts="yes" block_container="font_size:24|color:%23ffffff" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:400%20regular%3A400%3Anormal"][/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]',
),
'basicGrid_GoTopSlideout' => array(
'name' => __( 'Basic grid: Go top slideout', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="goTop20"][vc_gitem_zone_a height_mode="3-4" link="post_link" featured_image="yes"][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 link="post_link" featured_image=""][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" featured_image="" css=".vc_custom_1419254486087{background-color: #f2f2f2 !important;}"][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'basicGrid_TextFirst' => array(
'name' => __( 'Basic grid: Text first', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="flipHorizontalFadeIn"][vc_gitem_zone_a height_mode="1-1" link="post_link" featured_image="" css=".vc_custom_1419260513295{padding-right: 15px !important;padding-left: 15px !important;background-color: #2d2d2d !important;}"][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/1"][vc_gitem_post_title link="none" font_container="tag:div|text_align:left" use_custom_fonts="yes" block_container="font_size:24|color:%23ffffff|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:300%20light%20regular%3A300%3Anormal"][vc_separator color="white" align="align_left" border_width="2" el_width="50"][vc_gitem_post_excerpt link="none" font_container="tag:div|text_align:left" use_custom_fonts="yes" block_container="font_size:14|color:%23e2e2e2|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:400%20regular%3A400%3Anormal"][/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 link="post_link" featured_image="yes"][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]',
),
'basicGrid_SlideFromLeft' => array(
'name' => __( 'Basic grid: Slide from left', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="" position=""][vc_gitem_animated_block animation="slideInRight"][vc_gitem_zone_a height_mode="4-3" link="post_link" featured_image="yes"][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 link="post_link" featured_image=""][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" featured_image="" css=".vc_custom_1419258058654{padding-left: 15px !important;background-color: #282828 !important;}"][vc_gitem_post_date link="none" font_container="tag:div|text_align:left" use_custom_fonts="yes" block_container="font_size:12|color:%23efefef" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_title link="none" font_container="tag:h3|text_align:left" use_custom_fonts="yes" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:300%20light%20regular%3A300%3Anormal" block_container="font_size:20|color:%23ffffff"][/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]',
),
'basicGrid_SlideFromTop' => array(
'name' => __( 'Basic grid: Slide from top', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="slideTop"][vc_gitem_zone_a height_mode="1-1" link="post_link" featured_image="yes"][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 link="none" featured_image="" css=".vc_custom_1419260990461{padding-right: 15px !important;padding-left: 15px !important;}"][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/1" featured_image=""][vc_gitem_post_title link="none" font_container="tag:div|text_align:left" use_custom_fonts="yes" block_container="font_size:24|color:%23ffffff|line_height:1.2" google_fonts="font_family:Montserrat%3Aregular%2C700|font_style:700%20bold%20regular%3A700%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:div|text_align:left" use_custom_fonts="yes" block_container="font_size:14|color:%23ffffff|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:400%20regular%3A400%3Anormal"][vc_btn link="post_link" title="' . __( 'READ MORE', 'js_composer' ) . '" style="outline" shape="square" color="white" size="md" align="left"][/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]',
),
'masonryGrid_Default' => array(
'name' => __( 'Masonry grid: Default', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="bottom"][vc_gitem_animated_block][vc_gitem_zone_a height_mode="original" link="post_link" featured_image="yes"][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_zone_c css=".vc_custom_1419328663991{background-color: #f4f4f4 !important;}"][vc_gitem_row][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_btn link="post_link" title="' . __( 'Read more', 'js_composer' ) . '" style="flat" shape="rounded" color="juicy-pink" size="md" align="left"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_c][/vc_gitem]',
),
'masonryGrid_FadeIn' => array(
'name' => __( 'Masonry grid: Fade in', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="bottom"][vc_gitem_animated_block animation="fadeIn"][vc_gitem_zone_a height_mode="original" link="post_link" featured_image="yes"][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 link="post_link" featured_image="" css=".vc_custom_1419328603590{background-color: rgba(255,255,255,0.2) !important;*background-color: rgb(255,255,255) !important;}"][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_zone_c css=".vc_custom_1419328565352{background-color: #f4f4f4 !important;}"][vc_gitem_row][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_btn link="post_link" title="' . __( 'Read more', 'js_composer' ) . '" style="flat" shape="rounded" color="juicy-pink" size="md" align="left"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_c][/vc_gitem]',
),
'masonryGrid_IconSlideOut' => array(
'name' => __( 'Masonry grid: Icon slide out', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="bottom"][vc_gitem_animated_block animation="slideBottom"][vc_gitem_zone_a height_mode="original" link="none" featured_image="yes"][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 link="post_link" featured_image="" css=".vc_custom_1419328999899{background-color: rgba(0,0,0,0.5) !important;*background-color: rgb(0,0,0) !important;}"][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/1"][vc_icon type="fontawesome" icon_fontawesome="fa fa-search" icon_openiconic="vc-oi vc-oi-dial" icon_typicons="typcn typcn-adjust-brightness" icon_entypo="entypo-icon entypo-icon-note" icon_linecons="vc_li vc_li-heart" color="white" background_color="blue" size="md" align="center"][/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_zone_c css=".vc_custom_1419328781574{background-color: #f4f4f4 !important;}"][vc_gitem_row][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_btn link="post_link" title="' . __( 'Read more', 'js_composer' ) . '" style="flat" shape="rounded" color="juicy-pink" size="md" align="left"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_c][/vc_gitem]',
),
'masonryGrid_SlideFromLeft' => array(
'name' => __( 'Masonry grid: Slide from left', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="slideInRight"][vc_gitem_zone_a height_mode="original" link="none" featured_image="yes"][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 link="post_link" featured_image="" css=".vc_custom_1419328927507{background-color: #f4f4f4 !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_separator color="black" align="align_left" border_width="2" el_width="50"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1"][/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]',
),
'masonryGrid_GoTop' => array(
'name' => __( 'Masonry grid: Go top', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="goTop20"][vc_gitem_zone_a height_mode="original" link="post_link" featured_image="yes"][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 link="post_link" featured_image=""][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" featured_image="" css=".vc_custom_1419329081651{background-color: #2b2b2b !important;}"][vc_gitem_post_title link="none" font_container="tag:div|text_align:left" use_custom_fonts="yes" block_container="font_size:20|color:%23ffffff|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:500%20bold%20regular%3A500%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:div|text_align:left" use_custom_fonts="yes" block_container="font_size:14|color:%23efefef|line_height:1.2" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:400%20regular%3A400%3Anormal"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'masonryGrid_OverlayWithRotation' => array(
'name' => __( 'Masonry grid: Overlay with rotation', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="scaleRotateIn"][vc_gitem_zone_a height_mode="original" link="post_link" featured_image="yes"][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 link="post_link" featured_image="" css=".vc_custom_1419329305433{background-color: rgba(0,0,0,0.5) !important;*background-color: rgb(0,0,0) !important;}"][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/1"][vc_gitem_post_date link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:12|color:%23dbdbdb" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:300%20light%20regular%3A300%3Anormal"][vc_gitem_post_title link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:24|color:%23ffffff|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:400%20regular%3A400%3Anormal"][/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]',
),
'masonryGrid_BlurOut' => array(
'name' => __( 'Masonry grid: Blur out', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="blurOut"][vc_gitem_zone_a height_mode="original" link="post_link" featured_image="yes"][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 link="post_link" featured_image="" css=".vc_custom_1419329691977{background-color: rgba(0,0,0,0.5) !important;*background-color: rgb(0,0,0) !important;}"][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/1" featured_image=""][vc_gitem_post_title link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:24|color:%23ffffff|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:300%20light%20regular%3A300%3Anormal"][vc_separator color="grey" align="align_center" el_width="50"][vc_gitem_post_excerpt link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:14|color:%23ffffff|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:400%20regular%3A400%3Anormal"][/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]',
),
'masonryGrid_ScaleWithRotation' => array(
'name' => __( 'Masonry grid: Scale with rotation', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="bottom" position=""][vc_gitem_animated_block animation="scaleRotateIn"][vc_gitem_zone_a height_mode="original" link="post_link" featured_image="yes"][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/1"][/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 link="post_link" featured_image="" css=".vc_custom_1419333125675{background-color: rgba(255,255,255,0.2) !important;*background-color: rgb(255,255,255) !important;}"][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/1"][/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_zone_c css=".vc_custom_1419333453605{background-color: #f4f4f4 !important;}"][vc_gitem_row][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_btn link="post_link" title="' . __( 'Read more', 'js_composer' ) . '" style="flat" shape="rounded" color="juicy-pink" size="md" align="left"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_c][/vc_gitem]',
),
'masonryGrid_SlideoOutFromRight' => array(
'name' => __( 'Masonry grid: Slideo out from right', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="slideInLeft"][vc_gitem_zone_a height_mode="original" link="post_link" featured_image="yes"][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 link="post_link" featured_image=""][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" featured_image=""][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2" featured_image="" css=".vc_custom_1419333716781{margin-bottom: 25px !important;padding-top: 20px !important;padding-left: 20px !important;background-color: #282828 !important;}"][vc_gitem_post_title link="none" font_container="tag:div|text_align:left" use_custom_fonts="yes" block_container="font_size:24|color:%23ffffff|line_height:1.3" google_fonts="font_family:Montserrat%3Aregular%2C700|font_style:400%20regular%3A400%3Anormal"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'masonryGrid_WithSideContent' => array(
'name' => __( 'Masonry grid: With side content', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="right" css=".vc_custom_1419334531994{background-color: #f4f4f4 !important;}"][vc_gitem_animated_block animation="blurScaleOut"][vc_gitem_zone_a height_mode="original" link="post_link" featured_image="yes"][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 link="post_link" featured_image="" css=".vc_custom_1419334566318{background-color: rgba(255,255,255,0.2) !important;*background-color: rgb(255,255,255) !important;}"][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_zone_c][vc_gitem_row][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_date link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_btn link="post_link" title="' . __( 'Read more', 'js_composer' ) . '" style="flat" shape="rounded" color="juicy-pink" size="md" align="left"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_c][/vc_gitem]',
),
'mediaGrid_Default' => array(
'name' => __( 'Media grid: Default', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block][vc_gitem_zone_a height_mode="1-1" link="image_lightbox" featured_image="yes"][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]',
),
'mediaGrid_SimpleOverlay' => array(
'name' => __( 'Media grid: Simple overlay', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="none"][vc_gitem_zone_a height_mode="1-1" link="none" featured_image="yes"][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 link="image_lightbox" featured_image="yes" css=".vc_custom_1419000810062{margin: -15px !important;}"][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]',
),
'mediaGrid_FadeInWithIcon' => array(
'name' => __( 'Media grid: Fade in with icon', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="fadeIn"][vc_gitem_zone_a height_mode="4-3" link="none" featured_image="yes"][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 link="image_lightbox" featured_image="" css=".vc_custom_1419001011185{background-color: rgba(40,40,40,0.5) !important;*background-color: rgb(40,40,40) !important;}"][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/1"][vc_icon type="entypo" icon_fontawesome="fa fa-adjust" icon_openiconic="vc-oi vc-oi-eye" icon_typicons="typcn typcn-adjust-brightness" icon_entypo="entypo-icon entypo-icon-plus" icon_linecons="vc_li vc_li-heart" color="white" background_color="blue" size="lg" align="center"][/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]',
),
'mediaGrid_BorderedScaleWithTitle' => array(
'name' => __( 'Media grid: Bordered scale with title', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="scaleRotateIn"][vc_gitem_zone_a height_mode="3-4" link="none" featured_image="yes"][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 link="image_lightbox" featured_image="" css=".vc_custom_1419001608026{margin-top: 5px !important;margin-right: 5px !important;margin-bottom: 5px !important;margin-left: 5px !important;border-top-width: 5px !important;border-right-width: 5px !important;border-bottom-width: 5px !important;border-left-width: 5px !important;border-left-color: #ffffff !important;border-left-style: solid !important;border-right-color: #ffffff !important;border-right-style: solid !important;border-top-color: #ffffff !important;border-top-style: solid !important;border-bottom-color: #ffffff !important;border-bottom-style: solid !important;}"][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/1" featured_image="" css=".vc_custom_1419001517455{padding-right: 15px !important;padding-left: 15px !important;}"][vc_gitem_post_title link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:24|color:%23ffffff|line_height:1.3" google_fonts="font_family:Open%20Sans%3A300%2C300italic%2Cregular%2Citalic%2C600%2C600italic%2C700%2C700italic%2C800%2C800italic|font_style:400%20regular%3A400%3Anormal"][/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]',
),
'mediaGrid_ScaleWithRotation' => array(
'name' => __( 'Media grid: Scale with rotation', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="scaleRotateIn"][vc_gitem_zone_a height_mode="1-1" link="none" featured_image="yes"][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 link="image_lightbox" featured_image="" css=".vc_custom_1419001365234{background-color: rgba(0,0,0,0.3) !important;*background-color: rgb(0,0,0) !important;}"][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]',
),
'mediaGrid_SlideOutCaption' => array(
'name' => __( 'Media grid: Slide out caption', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="slideBottom"][vc_gitem_zone_a height_mode="1-1" link="none" featured_image="yes"][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 link="image_lightbox" featured_image="" css=".vc_custom_1419002217534{padding-right: 20px !important;padding-left: 20px !important;background-color: #4f4f4f !important;}"][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/1"][vc_gitem_post_title link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:30|color:%23ffffff|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:100%20light%20regular%3A100%3Anormal"][vc_separator color="white" align="align_center" border_width="2" el_width="50"][vc_gitem_post_excerpt link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:14|color:%23ffffff|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:400%20regular%3A400%3Anormal"][/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]',
),
'mediaGrid_HorizontalFlipWithFade' => array(
'name' => __( 'Media grid: Horizontal flip with fade', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="flipHorizontalFadeIn"][vc_gitem_zone_a height_mode="1-1" link="none" featured_image="yes"][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 link="image_lightbox" featured_image="" css=".vc_custom_1419002089906{background-color: #4f4f4f !important;}"][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/1" featured_image="" css=".vc_custom_1419002184955{padding-right: 15px !important;padding-left: 15px !important;}"][vc_gitem_post_date link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:12|color:%23e0e0e0|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_title link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:30|color:%23ffffff|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:100%20light%20regular%3A100%3Anormal"][/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]',
),
'mediaGrid_BlurWithContentBlock' => array(
'name' => __( 'Media grid: Blur with content block', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="bottom"][vc_gitem_animated_block animation="blurScaleOut"][vc_gitem_zone_a height_mode="1-1" link="none" featured_image="yes"][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 link="image_lightbox" featured_image="" css=".vc_custom_1419002895369{background-color: rgba(255,255,255,0.15) !important;*background-color: rgb(255,255,255) !important;}"][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_zone_c css=".vc_custom_1419240502350{background-color: #f9f9f9 !important;}"][vc_gitem_row][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_c][/vc_gitem]',
),
'mediaGrid_SlideInTitle' => array(
'name' => __( 'Media grid: Slide in title', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="slideTop"][vc_gitem_zone_a height_mode="4-3" link="none" featured_image="yes"][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 link="image_lightbox"][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/1" featured_image="" css=".vc_custom_1419003984488{padding-right: 15px !important;padding-left: 15px !important;}"][vc_gitem_post_title link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:18|color:%23ffffff|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:500%20bold%20regular%3A500%3Anormal"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/2" featured_image=""][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'mediaGrid_ScaleInWithIcon' => array(
'name' => __( 'Media grid: Scale in with icon', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="scaleIn"][vc_gitem_zone_a height_mode="1-1" link="none" featured_image="yes"][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 link="image_lightbox"][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/1"][vc_icon type="fontawesome" icon_fontawesome="fa fa-search" icon_openiconic="vc-oi vc-oi-dial" icon_typicons="typcn typcn-adjust-brightness" icon_entypo="entypo-icon entypo-icon-note" icon_linecons="vc_li vc_li-heart" color="white" background_color="white" size="lg" align="center"][/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]',
),
'masonryMedia_Default' => array(
'name' => __( 'Masonry media: Default', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block][vc_gitem_zone_a height_mode="original" link="image_lightbox" featured_image="yes"][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/1"][/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]',
),
'masonryMedia_BorderedScale' => array(
'name' => __( 'Masonry media: Bordered scale', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="scaleIn"][vc_gitem_zone_a height_mode="original" link="none" featured_image="yes"][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 link="image_lightbox" featured_image="" css=".vc_custom_1418993682046{border: 10px solid #e8e8e8 !important;}"][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]',
),
'masonryMedia_SolidBlurOut' => array(
'name' => __( 'Masonry media: Solid blur out', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="blurOut"][vc_gitem_zone_a height_mode="original" link="none" featured_image="yes"][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 link="image_lightbox" featured_image="" css=".vc_custom_1418993823084{background-color: rgba(0,0,0,0.4) !important;*background-color: rgb(0,0,0) !important;}"][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/1"][vc_icon type="typicons" icon_fontawesome="fa fa-adjust" icon_openiconic="vc-oi vc-oi-resize-full-alt" icon_typicons="typcn typcn-zoom-outline" icon_entypo="entypo-icon entypo-icon-note" icon_linecons="vc_li vc_li-heart" color="white" background_color="white" size="lg" align="center"][/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]',
),
'masonryMedia_ScaleWithRotationLight' => array(
'name' => __( 'Masonry media: Scale with rotation light', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="scaleRotateIn"][vc_gitem_zone_a height_mode="original" link="none" featured_image="yes"][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 link="image_lightbox" featured_image="" css=".vc_custom_1418994252440{background-color: rgba(255,255,255,0.2) !important;*background-color: rgb(255,255,255) !important;}"][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]',
),
'masonryMedia_SlideWithTitleAndCaption' => array(
'name' => __( 'Masonry media: Slide with title and caption', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="" position=""][vc_gitem_animated_block animation="slideBottom"][vc_gitem_zone_a height_mode="original" link="none" featured_image="yes"][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/1"][/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 link="image_lightbox" featured_image=""][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/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1" featured_image="" css=".vc_custom_1418995080777{padding-top: 15px !important;padding-right: 15px !important;padding-bottom: 15px !important;padding-left: 15px !important;background-color: rgba(45,45,45,0.8) !important;*background-color: rgb(45,45,45) !important;}"][vc_gitem_post_title link="none" font_container="tag:div|text_align:left" use_custom_fonts="yes" block_container="font_size:18|color:%23ffffff|line_height:1.2" google_fonts="font_family:Montserrat%3Aregular%2C700|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="yes" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:400%20regular%3A400%3Anormal" block_container="font_size:14|color:%23ffffff|line_height:1.3"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'masonryMedia_ScaleWithContentBlock' => array(
'name' => __( 'Masonry media: Scale with content block', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="bottom"][vc_gitem_animated_block animation="scaleRotateIn"][vc_gitem_zone_a height_mode="original" link="image_lightbox" featured_image="yes"][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 link="none" featured_image=""][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_zone_c css=".vc_custom_1418995850605{padding-top: 5px !important;padding-right: 15px !important;padding-bottom: 5px !important;padding-left: 15px !important;background-color: #f9f9f9 !important;}"][vc_gitem_row][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" block_container="font_size:18|line_height:1.2" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_c][/vc_gitem]',
),
'masonryMedia_SimpleOverlay' => array(
'name' => __( 'Masonry media: Simple overlay', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="none"][vc_gitem_zone_a height_mode="original" link="none" featured_image="yes"][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 link="image_lightbox" featured_image="" css=".vc_custom_1419337784115{background-color: #262626 !important;}"][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/1"][vc_gitem_post_title link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:24|color:%23ffffff|line_height:1.3" google_fonts="font_family:Montserrat%3Aregular%2C700|font_style:400%20regular%3A400%3Anormal"][/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]',
),
'masonryMedia_SlideTop' => array(
'name' => __( 'Masonry media: Slide top', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="slideTop"][vc_gitem_zone_a height_mode="original" link="none" featured_image="yes"][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 link="image_lightbox" featured_image="" css=".vc_custom_1419337643064{background-color: rgba(10,10,10,0.5) !important;*background-color: rgb(10,10,10) !important;}"][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/1"][vc_icon type="fontawesome" icon_fontawesome="fa fa-search" icon_openiconic="vc-oi vc-oi-dial" icon_typicons="typcn typcn-adjust-brightness" icon_entypo="entypo-icon entypo-icon-note" icon_linecons="vc_li vc_li-heart" color="white" background_color="blue" size="md" align="center"][/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]',
),
'masonryMedia_SimpleBlurWithScale' => array(
'name' => __( 'Masonry media: Simple blur with scale', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="blurScaleOut"][vc_gitem_zone_a height_mode="original" link="image_lightbox" featured_image="yes" css=".vc_custom_1419338012126{background-color: rgba(10,10,10,0.7) !important;*background-color: rgb(10,10,10) !important;}"][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 link="none" featured_image=""][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]',
),
);
@@ -0,0 +1,30 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @param $settings
* @param $value
*
* @since 4.2
* @return string
*/
function vc_vc_link_form_field( $settings, $value ) {
$link = vc_build_link( $value );
return '<div class="vc_link">'
. '<input name="' . $settings['param_name'] . '" class="wpb_vc_param_value ' . $settings['param_name'] . ' ' . $settings['type'] . '_field" type="hidden" value="' . htmlentities( $value, ENT_QUOTES, 'utf-8' ) . '" data-json="' . htmlentities( json_encode( $link ), ENT_QUOTES, 'utf-8' ) . '" />'
. '<a href="#" class="button vc_link-build ' . $settings['param_name'] . '_button">' . __( 'Select URL', 'js_composer' ) . '</a> <span class="vc_link_label_title vc_link_label">' . __( 'Title', 'js_composer' ) . ':</span> <span class="title-label">' . $link['title'] . '</span> <span class="vc_link_label">' . __( 'URL', 'js_composer' ) . ':</span> <span class="url-label">' . $link['url'] . ' ' . $link['target'] . '</span>'
. '</div>';
}
/**
* @param $value
*
* @since 4.2
* @return array
*/
function vc_build_link( $value ) {
return vc_parse_multi_attribute( $value, array( 'url' => '', 'title' => '', 'target' => '', 'rel' => '' ) );
}