????
| Current Path : /home2/morganrand/www/wp-content/themes/wanderfuls/framework/visual-composer/shortcodes/ |
| Current File : /home2/morganrand/www/wp-content/themes/wanderfuls/framework/visual-composer/shortcodes/pricing.php |
<?php
/**
* Visual Composer Pricing
*
* @package Wanderfuls WordPress Theme
* @subpackage VC Functions
* @version 3.0.0
*/
/**
* Register shortcode with VC Composer
*
* @since 2.0.0
*/
class WPBakeryShortCode_vcex_pricing extends WPBakeryShortCode {
protected function content( $atts, $content = null ) {
ob_start();
include( locate_template( 'vcex_templates/vcex_pricing.php' ) );
return ob_get_clean();
}
}
/**
* Parse shortcode attributes and set correct values
*
* @since 2.0.0
*/
function parse_vcex_pricing_atts( $atts ) {
// Convert textfield link to vc_link
if ( ! empty( $atts['button_url'] ) && false === strpos( $atts['button_url'], 'url:' ) ) {
$url = 'url:'. $atts['button_url'] .'|';
$atts['button_url'] = $url;
}
// Return $atts
return $atts;
}
add_filter( 'vc_edit_form_fields_attributes_vcex_pricing', 'parse_vcex_pricing_atts' );
/**
* Adds the shortcode to the Visual Composer
*
* @since Wanderfuls 1.4.1
*/
function vcex_pricing_shortcode_vc_map() {
vc_map( array(
'name' => __( 'Pricing Table', 'tb' ),
'description' => __( 'Insert a pricing column', 'tb' ),
'base' => 'vcex_pricing',
'category' => TB_THEME_BRANDING,
'icon' => 'vcex-pricing vcex-icon fa fa-usd',
'params' => array(
// General
array(
'type' => 'textfield',
'heading' => __( 'Unique Id', 'tb' ),
'param_name' => 'unique_id',
),
array(
'type' => 'textfield',
'heading' => __( 'Classes', 'tb' ),
'param_name' => 'el_class',
),
array(
'type' => 'dropdown',
'heading' => __( 'Visibility', 'tb' ),
'param_name' => 'visibility',
'value' => array_flip( tb_visibility() ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Appear Animation', 'tb'),
'param_name' => 'css_animation',
'value' => array_flip( tb_css_animations() ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Hover Animation', 'tb'),
'param_name' => 'hover_animation',
'value' => array_flip( tb_hover_css_animations() ),
),
// Plan
array(
'type' => 'dropdown',
'heading' => __( 'Featured', 'tb' ),
'param_name' => 'featured',
'value' => array(
__( 'No', 'tb' ) => 'no',
__( 'Yes', 'tb') => 'yes',
),
'group' => __( 'Plan', 'tb' ),
),
array(
'type' => 'textfield',
'heading' => __( 'Plan', 'tb' ),
'param_name' => 'plan',
'group' => __( 'Plan', 'tb' ),
'std' => __( 'Basic', 'tb' ),
),
array(
'type' => 'colorpicker',
'heading' => __( 'Background', 'tb' ),
'param_name' => 'plan_background',
'group' => __( 'Plan', 'tb' ),
'dependency' => Array( 'element' => 'plan', 'not_empty' => true ),
),
array(
'type' => 'colorpicker',
'heading' => __( 'Color', 'tb' ),
'param_name' => 'plan_color',
'group' => __( 'Plan', 'tb' ),
'dependency' => Array( 'element' => 'plan', 'not_empty' => true ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Font Weight', 'tb' ),
'param_name' => 'plan_weight',
'std' => '',
'value' => array_flip( tb_font_weights() ),
'group' => __( 'Plan', 'tb' ),
'dependency' => Array( 'element' => 'plan', 'not_empty' => true ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Text Transform', 'tb' ),
'param_name' => 'plan_text_transform',
'std' => '',
'value' => array_flip( tb_text_transforms() ),
'group' => __( 'Plan', 'tb' ),
'dependency' => Array( 'element' => 'plan', 'not_empty' => true ),
),
array(
'type' => 'textfield',
'heading' => __( 'Font Size', 'tb' ),
'param_name' => 'plan_size',
'group' => __( 'Plan', 'tb' ),
'dependency' => Array( 'element' => 'plan', 'not_empty' => true ),
),
array(
'type' => 'textfield',
'heading' => __( 'Letter Spacing', 'tb' ),
'param_name' => 'plan_letter_spacing',
'group' => __( 'Plan', 'tb' ),
'dependency' => Array( 'element' => 'plan', 'not_empty' => true ),
'description' => __( 'Please enter a px value.', 'tb' ),
),
array(
'type' => 'textfield',
'heading' => __( 'Padding', 'tb' ),
'param_name' => 'plan_padding',
'description' => __( 'Please use the following format: top right bottom left.', 'tb' ),
'group' => __( 'Plan', 'tb' ),
'dependency' => Array( 'element' => 'plan', 'not_empty' => true ),
),
array(
'type' => 'textfield',
'heading' => __( 'Margin', 'tb' ),
'param_name' => 'plan_margin',
'description' => __( 'Please use the following format: top right bottom left.', 'tb' ),
'group' => __( 'Plan', 'tb' ),
'dependency' => Array( 'element' => 'plan', 'not_empty' => true ),
),
array(
'type' => 'textfield',
'heading' => __( 'Border', 'tb' ),
'param_name' => 'plan_border',
'description' => __( 'Please use the shorthand format: width style color. Enter 0px or "none" to disable border.', 'tb' ),
'group' => __( 'Plan', 'tb' ),
'dependency' => Array( 'element' => 'plan', 'not_empty' => true ),
),
// Cost
array(
'type' => 'textfield',
'heading' => __( 'Cost', 'tb' ),
'param_name' => 'cost',
'group' => __( 'Cost', 'tb' ),
'std' => '$20',
),
array(
'type' => 'colorpicker',
'heading' => __( 'Background', 'tb' ),
'param_name' => 'cost_background',
'group' => __( 'Cost', 'tb' ),
'dependency' => Array( 'element' => 'cost', 'not_empty' => true ),
),
array(
'type' => 'colorpicker',
'heading' => __( 'Color', 'tb' ),
'param_name' => 'cost_color',
'group' => __( 'Cost', 'tb' ),
'dependency' => Array( 'element' => 'cost', 'not_empty' => true ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Font Weight', 'tb' ),
'param_name' => 'cost_weight',
'std' => '',
'value' => array_flip( tb_font_weights() ),
'group' => __( 'Cost', 'tb' ),
'dependency' => Array( 'element' => 'cost', 'not_empty' => true ),
),
array(
'type' => 'textfield',
'heading' => __( 'Font Size', 'tb' ),
'param_name' => 'cost_size',
'group' => __( 'Cost', 'tb' ),
'dependency' => Array( 'element' => 'cost', 'not_empty' => true ),
),
array(
'type' => 'textfield',
'heading' => __( 'Padding', 'tb' ),
'param_name' => 'cost_padding',
'description' => __( 'Please use the following format: top right bottom left.', 'tb' ),
'group' => __( 'Cost', 'tb' ),
'dependency' => Array( 'element' => 'cost', 'not_empty' => true ),
),
array(
'type' => 'textfield',
'heading' => __( 'Border', 'tb' ),
'param_name' => 'cost_border',
'description' => __( 'Please use the shorthand format: width style color. Enter 0px or "none" to disable border.', 'tb' ),
'group' => __( 'Cost', 'tb' ),
'dependency' => Array( 'element' => 'cost', 'not_empty' => true ),
),
// Per
array(
'type' => 'textfield',
'heading' => __( 'Per', 'tb' ),
'param_name' => 'per',
'group' => __( 'Per', 'tb' ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Display', 'tb' ),
'param_name' => 'per_display',
'value' => array(
__( 'Default', 'tb' ) => '',
__( 'Inline', 'tb' ) => 'inline',
__( 'Block', 'tb' ) => 'block',
__( 'Inline-Block', 'tb' ) => 'inline-block',
),
'group' => __( 'Per', 'tb' ),
'dependency' => Array(
'element' => 'per',
'not_empty' => true,
),
),
array(
'type' => 'colorpicker',
'heading' => __( 'Color', 'tb' ),
'param_name' => 'per_color',
'group' => __( 'Per', 'tb' ),
'dependency' => Array(
'element' => 'per',
'not_empty' => true,
),
),
array(
'type' => 'dropdown',
'heading' => __( 'Font Weight', 'tb' ),
'param_name' => 'per_weight',
'std' => '',
'value' => array_flip( tb_font_weights() ),
'group' => __( 'Per', 'tb' ),
'dependency' => Array(
'element' => 'per',
'not_empty' => true,
),
),
array(
'type' => 'dropdown',
'heading' => __( 'Text Transform', 'tb' ),
'param_name' => 'per_transform',
'group' => __( 'Per', 'tb' ),
'value' => array_flip( tb_text_transforms() ),
'dependency' => Array(
'element' => 'per',
'not_empty' => true,
),
),
array(
'type' => 'textfield',
'heading' => __( 'Font Size', 'tb' ),
'param_name' => 'per_size',
'group' => __( 'Per', 'tb' ),
'dependency' => Array(
'element' => 'per',
'not_empty' => true,
),
),
// Features
array(
'type' => 'textarea_html',
'heading' => __( 'Features', 'tb' ),
'param_name' => 'content',
'value' => '<ul>
<li>30GB Storage</li>
<li>512MB Ram</li>
<li>10 databases</li>
<li>1,000 Emails</li>
<li>25GB Bandwidth</li>
</ul>',
'description' => __('Enter your pricing content. You can use a UL list as shown by default but anything would really work!','tb'),
'group' => __( 'Features', 'tb' ),
),
array(
'type' => 'colorpicker',
'heading' => __( 'Color', 'tb' ),
'param_name' => 'font_color',
'group' => __( 'Features', 'tb' ),
),
array(
'type' => 'colorpicker',
'heading' => __( 'Background', 'tb' ),
'param_name' => 'features_bg',
'group' => __( 'Features', 'tb' ),
),
array(
'type' => 'textfield',
'heading' => __( 'Font Size', 'tb' ),
'param_name' => 'font_size',
'group' => __( 'Features', 'tb' ),
),
array(
'type' => 'textfield',
'heading' => __( 'Padding', 'tb' ),
'param_name' => 'features_padding',
'description' => __( 'Please use the following format: top right bottom left.', 'tb' ),
'group' => __( 'Features', 'tb' ),
),
array(
'type' => 'textfield',
'heading' => __( 'Border', 'tb' ),
'param_name' => 'features_border',
'description' => __( 'Please use the shorthand format: width style color. Enter 0px or "none" to disable border.', 'tb' ),
'group' => __( 'Features', 'tb' ),
),
// Button
array(
'type' => 'textarea_raw_html',
'heading' => __( 'Custom Button HTML', 'tb' ),
'param_name' => 'custom_button',
'description' => __( 'Enter your custom button HTML, such as your paypal button code.', 'tb' ),
'group' => __( 'Button', 'tb' ),
),
array(
'type' => 'vc_link',
'heading' => __( 'URL', 'tb' ),
'param_name' => 'button_url',
'group' => __( 'Button', 'tb' ),
'dependency' => array( 'element' => 'custom_button', 'is_empty' => true ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Local Scroll?', 'tb' ),
'param_name' => 'button_local_scroll',
'group' => __( 'Button', 'tb' ),
'value' => array(
__( 'No', 'tb' ) => 'false',
__( 'Yes', 'tb') => 'true',
),
'dependency' => array( 'element' => 'custom_button', 'is_empty' => true ),
),
array(
'type' => 'textfield',
'heading' => __( 'Text', 'tb' ),
'param_name' => 'button_text',
'value' => __( 'Text', 'tb' ),
'group' => __( 'Button', 'tb' ),
'dependency' => array( 'element' => 'custom_button', 'is_empty' => true ),
),
array(
'type' => 'colorpicker',
'heading' => _x( 'Area Background', 'Pricing Button Area Setting', 'tb' ),
'param_name' => 'button_wrap_bg',
'group' => __( 'Button', 'tb' ),
),
array(
'type' => 'textfield',
'heading' => _x( 'Area Padding', 'Pricing Button Area Setting', 'tb' ),
'param_name' => 'button_wrap_padding',
'description' => __( 'Please use the following format: top right bottom left.', 'tb' ),
'group' => __( 'Button', 'tb' ),
),
array(
'type' => 'textfield',
'heading' => _x( 'Area Border', 'Pricing Button Area Setting', 'tb' ),
'param_name' => 'button_wrap_border',
'description' => __( 'Please use the shorthand format: width style color. Enter 0px or "none" to disable border.', 'tb' ),
'group' => __( 'Button', 'tb' ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Style', 'tb' ),
'param_name' => 'button_style',
'value' => array_flip( tb_button_styles() ),
'group' => __( 'Button', 'tb' ),
'dependency' => array( 'element' => 'custom_button', 'is_empty' => true ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Color', 'tb' ),
'param_name' => 'button_style_color',
'value' => array_flip( tb_button_colors() ),
'group' => __( 'Button', 'tb' ),
'dependency' => array( 'element' => 'custom_button', 'is_empty' => true ),
),
array(
'type' => 'colorpicker',
'heading' => __( 'Background', 'tb' ),
'param_name' => 'button_bg_color',
'group' => __( 'Button', 'tb' ),
'dependency' => array( 'element' => 'custom_button', 'is_empty' => true ),
),
array(
'type' => 'colorpicker',
'heading' => __( 'Background: Hover', 'tb' ),
'param_name' => 'button_hover_bg_color',
'group' => __( 'Button', 'tb' ),
'dependency' => array( 'element' => 'custom_button', 'is_empty' => true ),
),
array(
'type' => 'colorpicker',
'heading' => __( 'Color', 'tb' ),
'param_name' => 'button_color',
'group' => __( 'Button', 'tb' ),
'dependency' => array( 'element' => 'custom_button', 'is_empty' => true ),
),
array(
'type' => 'colorpicker',
'heading' => __( 'Color: Hover', 'tb' ),
'param_name' => 'button_hover_color',
'group' => __( 'Button', 'tb' ),
'dependency' => array( 'element' => 'custom_button', 'is_empty' => true ),
),
array(
'type' => 'textfield',
'heading' => __( 'Font Size', 'tb' ),
'param_name' => 'button_size',
'group' => __( 'Button', 'tb' ),
'dependency' => array( 'element' => 'custom_button', 'is_empty' => true ),
),
array(
'type' => 'textfield',
'heading' => __( 'Border Radius', 'tb' ),
'param_name' => 'button_border_radius',
'group' => __( 'Button', 'tb' ),
'dependency' => array( 'element' => 'custom_button', 'is_empty' => true ),
),
array(
'type' => 'textfield',
'heading' => __( 'Letter Spacing', 'tb' ),
'param_name' => 'button_letter_spacing',
'group' => __( 'Button', 'tb' ),
'dependency' => array( 'element' => 'custom_button', 'is_empty' => true ),
),
array(
'type' => 'textfield',
'heading' => __( 'Padding', 'tb' ),
'param_name' => 'button_padding',
'description' => __( 'Please use the following format: top right bottom left.', 'tb' ),
'group' => __( 'Button', 'tb' ),
'dependency' => array( 'element' => 'custom_button', 'is_empty' => true ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Font Weight', 'tb' ),
'param_name' => 'button_weight',
'std' => '',
'value' => array_flip( tb_font_weights() ),
'group' => __( 'Button', 'tb' ),
'dependency' => array( 'element' => 'custom_button', 'is_empty' => true ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Text Transform', 'tb' ),
'param_name' => 'button_transform',
'group' => __( 'Button', 'tb' ),
'value' => array_flip( tb_text_transforms() ),
'dependency' => array( 'element' => 'custom_button', 'is_empty' => true ),
),
//Icons
array(
'type' => 'dropdown',
'heading' => __( 'Icon library', 'tb' ),
'param_name' => 'icon_type',
'description' => __( 'Select icon library.', 'tb' ),
'std' => 'fontawesome',
'value' => array(
__( 'Font Awesome', 'tb' ) => 'fontawesome',
__( 'Open Iconic', 'tb' ) => 'openiconic',
__( 'Typicons', 'tb' ) => 'typicons',
__( 'Entypo', 'tb' ) => 'entypo',
__( 'Linecons', 'tb' ) => 'linecons',
__( 'Pixel', 'tb' ) => 'pixelicons',
),
'group' => __( 'Button Icons', 'tb' ),
'dependency' => array( 'element' => 'custom_button', 'is_empty' => true ),
),
array(
'type' => 'iconpicker',
'heading' => __( 'Icon Left', 'tb' ),
'param_name' => 'button_icon_left',
'admin_label' => true,
'settings' => array(
'emptyIcon' => true,
'iconsPerPage' => 200,
),
'dependency' => array( 'element' => 'icon_type', 'value' => 'fontawesome' ),
'group' => __( 'Button Icons', 'tb' ),
),
array(
'type' => 'iconpicker',
'heading' => __( 'Icon Left', 'tb' ),
'param_name' => 'button_icon_left_openiconic',
'settings' => array(
'emptyIcon' => true,
'type' => 'openiconic',
'iconsPerPage' => 200,
),
'dependency' => array( 'element' => 'icon_type', 'value' => 'openiconic' ),
'group' => __( 'Button Icons', 'tb' ),
),
array(
'type' => 'iconpicker',
'heading' => __( 'Icon Left', 'tb' ),
'param_name' => 'button_icon_left_typicons',
'settings' => array(
'emptyIcon' => true,
'type' => 'typicons',
'iconsPerPage' => 200,
),
'dependency' => array(
'element' => 'icon_type',
'value' => 'typicons',
),
'group' => __( 'Button Icons', 'tb' ),
),
array(
'type' => 'iconpicker',
'heading' => __( 'Icon Left', 'tb' ),
'param_name' => 'button_icon_left_entypo',
'settings' => array(
'emptyIcon' => true,
'type' => 'entypo',
'iconsPerPage' => 300,
),
'dependency' => array(
'element' => 'icon_type',
'value' => 'entypo',
),
'group' => __( 'Button Icons', 'tb' ),
),
array(
'type' => 'iconpicker',
'heading' => __( 'Icon Left', 'tb' ),
'param_name' => 'button_icon_left_linecons',
'settings' => array(
'emptyIcon' => true,
'type' => 'linecons',
'iconsPerPage' => 200,
),
'dependency' => array(
'element' => 'icon_type',
'value' => 'linecons',
),
'group' => __( 'Button Icons', 'tb' ),
),
array(
'type' => 'iconpicker',
'heading' => __( 'Icon Left', 'tb' ),
'param_name' => 'button_icon_left_pixelicons',
'settings' => array(
'emptyIcon' => false,
'type' => 'pixelicons',
'source' => vcex_pixel_icons(),
),
'dependency' => array(
'element' => 'icon_type',
'value' => 'pixelicons',
),
'group' => __( 'Button Icons', 'tb' ),
),
array(
'type' => 'iconpicker',
'heading' => __( 'Icon Right', 'tb' ),
'param_name' => 'button_icon_right',
'admin_label' => true,
'settings' => array(
'emptyIcon' => true,
'iconsPerPage' => 200,
),
'dependency' => array(
'element' => 'icon_type',
'value' => 'fontawesome',
),
'group' => __( 'Button Icons', 'tb' ),
),
array(
'type' => 'iconpicker',
'heading' => __( 'Icon Right', 'tb' ),
'param_name' => 'button_icon_right_openiconic',
'settings' => array(
'emptyIcon' => true,
'type' => 'openiconic',
'iconsPerPage' => 200,
),
'dependency' => array(
'element' => 'icon_type',
'value' => 'openiconic',
),
'group' => __( 'Button Icons', 'tb' ),
),
array(
'type' => 'iconpicker',
'heading' => __( 'Icon Right', 'tb' ),
'param_name' => 'button_icon_right_typicons',
'settings' => array(
'emptyIcon' => true,
'type' => 'typicons',
'iconsPerPage' => 200,
),
'dependency' => array(
'element' => 'icon_type',
'value' => 'typicons',
),
'group' => __( 'Button Icons', 'tb' ),
),
array(
'type' => 'iconpicker',
'heading' => __( 'Icon Right', 'tb' ),
'param_name' => 'button_icon_right_entypo',
'settings' => array(
'emptyIcon' => true,
'type' => 'entypo',
'iconsPerPage' => 300,
),
'dependency' => array(
'element' => 'icon_type',
'value' => 'entypo',
),
'group' => __( 'Button Icons', 'tb' ),
),
array(
'type' => 'iconpicker',
'heading' => __( 'Icon Right', 'tb' ),
'param_name' => 'button_icon_right_linecons',
'settings' => array(
'emptyIcon' => true,
'type' => 'linecons',
'iconsPerPage' => 200,
),
'dependency' => array(
'element' => 'icon_type',
'value' => 'linecons',
),
'group' => __( 'Button Icons', 'tb' ),
),
array(
'type' => 'iconpicker',
'heading' => __( 'Icon Right', 'tb' ),
'param_name' => 'button_icon_right_pixelicons',
'settings' => array(
'emptyIcon' => false,
'type' => 'pixelicons',
'source' => vcex_pixel_icons(),
),
'dependency' => array(
'element' => 'icon_type',
'value' => 'pixelicons',
),
'group' => __( 'Button Icons', 'tb' ),
),
)
) );
}
add_action( 'vc_before_init', 'vcex_pricing_shortcode_vc_map' );