????

Your IP : 216.73.216.152


Current Path : /home2/morganrand/www/wp-content/themes/wanderfuls/framework/visual-composer/shortcodes/
Upload File :
Current File : /home2/morganrand/www/wp-content/themes/wanderfuls/framework/visual-composer/shortcodes/button.php

<?php
/**
 * Registers the button shortcode and adds it to the Visual Composer
 *
 * @package Wanderfuls WordPress Theme
 * @subpackage VC Templates
 * @version 3.0.0
 */

/**
 * Register shortcode with VC Composer
 *
 * @since 2.0.0
 */
class WPBakeryShortCode_vcex_button extends WPBakeryShortCode {
	protected function content( $atts, $content = null ) {
		ob_start();
		include( locate_template( 'vcex_templates/vcex_button.php' ) );
		return ob_get_clean();
	}
}

/**
 * Adds the shortcode to the Visual Composer
 *
 * @since 1.4.1
 */
function vcex_button_vc_map() {
	vc_map( array(
		'name' => __( 'Wanderfuls Button', 'tb' ),
		'description' => __( 'Eye catching button', 'tb' ),
		'base' => 'vcex_button',
		'category' => TB_THEME_BRANDING,
		'icon' => 'vcex-wanderfuls-button vcex-icon fa fa-external-link-square',
		'params' => array(
			// General
			array(
				'type' => 'textfield',
				'admin_label' => true,
				'heading' => __( 'Unique Id', 'tb' ),
				'param_name' => 'unique_id',
			),
			array(
				'type' => 'textfield',
				'admin_label' => true,
				'heading' => __( 'Classes', 'tb' ),
				'param_name' => 'classes',
			),
			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() ),
			),
			array(
				'type' => 'textfield',
				'heading' => __( 'URL', 'tb' ),
				'param_name' => 'url',
				'value' => 'http://www.google.com/',
			),
			array(
				'type' => 'textfield',
				'heading' => __( 'Text', 'tb' ),
				'param_name' => 'content',
				'admin_label' => true,
				'std' => 'Button Text',
			),
			array(
				'type' => 'textfield',
				'heading' => __( 'Link Title', 'tb' ),
				'param_name' => 'title',
				'value' => 'Visit Site',
			),
			array(
				'type' => 'dropdown',
				'heading' => __( 'Link Target', 'tb' ),
				'param_name' => 'target',
				'value' => array(
					__( 'Self', 'tb' ) => '',
					__( 'Blank', 'tb' ) => 'blank',
					__( 'Local', 'tb' ) => 'local',
				),
			),
			array(
				'type' => 'dropdown',
				'heading' => __( 'Link Rel', 'tb' ),
				'param_name' => 'rel',
				'value' => array(
					__( 'None', 'tb' ) => '',
					__( 'Nofollow', 'tb' ) => 'nofollow',
				),
			),
			// Design
			array(
				'type' => 'dropdown',
				'heading' => __( 'Style', 'tb' ),
				'param_name' => 'style',
				'std' => '',
				'value' => array_flip( tb_button_styles() ),
				'group' => __( 'Design', 'tb' ),
			),
			array(
				'type' => 'dropdown',
				'heading' => __( 'Layout', 'tb' ),
				'param_name' => 'layout',
				'value' => array(
					__( 'Inline', 'tb' ) => '',
					__( 'Block', 'tb' ) => 'block',
					__( 'Expanded (fit container)', 'tb' ) => 'expanded',
				),
				'group' => __( 'Design', 'tb' ),
			),
			array(
				'type' => 'dropdown',
				'heading' => __( 'Align', 'tb' ),
				'param_name' => 'align',
				'value' => array_flip( tb_alignments() ),
				'group' => __( 'Design', 'tb' ),
			),
			array(
				'type' => 'dropdown',
				'heading' => __( 'Size', 'tb' ),
				'param_name' => 'size',
				'std' => '',
				'value' => array(
					__( 'Default', 'tb' ) => '',
					__( 'Small', 'tb' ) => 'small',
					__( 'Medium', 'tb' ) => 'medium',
					__( 'Large', 'tb' ) => 'large',
				),
				'group' => __( 'Design', 'tb' ),
			),
			array(
				'type' => 'dropdown',
				'heading' => __( 'Font Family', 'tb' ),
				'param_name' => 'font_family',
				'std' => '',
				'value' => vcex_fonts_array(),
				'group' => __( 'Design', 'tb' ),
			),
			array(
				'type' => 'dropdown',
				'heading' => __( 'Color', 'tb' ),
				'param_name' => 'color',
				'std' => '',
				'value' => array_flip( tb_button_colors() ),
				'group' => __( 'Design', 'tb' ),
			),
			array(
				'type' => 'colorpicker',
				'heading' => __( 'Background', 'tb' ),
				'param_name' => 'custom_background',
				'group' => __( 'Design', 'tb' ),
			),
			array(
				'type' => 'colorpicker',
				'heading' => __( 'Background: Hover', 'tb' ),
				'param_name' => 'custom_hover_background',
				'group' => __( 'Design', 'tb' ),
			),
			array(
				'type' => 'colorpicker',
				'heading' => __( 'Color', 'tb' ),
				'param_name' => 'custom_color',
				'group' => __( 'Design', 'tb' ),
			),
			array(
				'type' => 'colorpicker',
				'heading' => __( 'Color: Hover', 'tb' ),
				'param_name' => 'custom_hover_color',
				'group' => __( 'Design', 'tb' ),
			),
			array(
				'type' => 'textfield',
				'heading' => __( 'Font Size', 'tb' ),
				'param_name' => 'font_size',
				'group' => __( 'Design', 'tb' ),
			),
			array(
				'type' => 'textfield',
				'heading' => __( 'Letter Spacing', 'tb' ),
				'param_name' => 'letter_spacing',
				'group' => __( 'Design', 'tb' ),
			),
			array(
				'type' => 'dropdown',
				'heading' => __( 'Text Transform', 'tb' ),
				'param_name' => 'text_transform',
				'group' => __( 'Design', 'tb' ),
				'value' => array_flip( tb_text_transforms() ),
				'std' => '',
			),
			array(
				'type' => 'dropdown',
				'heading' => __( 'Font Weight', 'tb' ),
				'param_name' => 'font_weight',
				'value' => array_flip( tb_font_weights() ),
				'std' => '',
				'group' => __( 'Design', 'tb' ),
			),
			array(
				'type' => 'textfield',
				'heading' => __( 'Custom Width', 'tb' ),
				'param_name' => 'width',
				'description' => __( 'Please use a pixel or percentage value.', 'tb' ),
				'group' => __( 'Design', 'tb' ),
			),
			array(
				'type' => 'textfield',
				'heading' => __( 'Border Radius', 'tb' ),
				'param_name' => 'border_radius',
				'description' => __( 'Please enter a px value.', 'tb' ),
				'group' => __( 'Design', 'tb' ),
			),
			array(
				'type' => 'textfield',
				'heading' => __( 'Padding', 'tb' ),
				'param_name' => 'font_padding',
				'description' => __( 'Please use the following format: top right bottom left.', 'tb' ),
				'group' => __( 'Design', 'tb' ),
			),
			array(
				'type' => 'textfield',
				'heading' => __( 'Margin', 'tb' ),
				'param_name' => 'margin',
				'description' => __( 'Please use the following format: top right bottom left.', 'tb' ),
				'group' => __( 'Design', 'tb' ),
			),
			// Lightbox
			array(
				'type' => 'dropdown',
				'heading' => __( 'Lightbox', 'tb' ),
				'param_name' => 'lightbox',
				'value' => Array(
					__( 'No', 'tb' ) => '',
					__( 'Yes', 'tb' ) => 'true',
				),
				'group' => __( 'Lightbox', 'tb' ),
			),
			array(
				'type' => 'dropdown',
				'heading' => __( 'Type', 'tb' ),
				'param_name' => 'lightbox_type',
				'value' => array(
					__( 'Auto Detect - slow', 'tb' ) => '',
					__( 'iFrame', 'tb' ) => 'iframe',
					__( 'Image', 'tb' ) => 'image',
					__( 'Video', 'tb' ) => 'video_embed',
					__( 'HTML5', 'tb' ) => 'html5',
					__( 'Quicktime', 'tb' ) => 'quicktime',
				),
				'description' => __( 'Auto detect depends on the iLightbox API, so by choosing your type it speeds things up and you also allows for HTTPS support.', 'tb' ),
				'group' => __( 'Lightbox', 'tb' ),
				'dependency' => Array( 'element' => 'lightbox', 'value' => 'true' ),
			),
			array(
				'type' => 'attach_image',
				'heading' => __( 'Lightbox Image', 'tb' ),
				'param_name' => 'lightbox_image',
				'dependency' => Array( 'element' => 'lightbox_type', 'value' => 'image' ),
				'group' => __( 'Lightbox', 'tb' ),
			),
			array(
				'type' => 'textfield',
				'heading' => __( 'HTML5 Webm URL', 'tb' ),
				'param_name' => 'lightbox_video_html5_webm',
				'description' => __( 'Enter the URL to a video, SWF file, flash file or a website URL to open in lightbox.', 'tb' ),
				'group' => __( 'Lightbox', 'tb' ),
				'dependency' => Array(
					'element' => 'lightbox_type',
					'value' => 'html5',
				),
			),
			array(
				'type' => 'attach_image',
				'heading' => __( 'Lightbox HTML5 Poster Image', 'tb' ),
				'param_name' => 'lightbox_poster_image',
				'dependency' => Array( 'element' => 'lightbox_type', 'value' => 'html5' ),
				'group' => __( 'Lightbox', 'tb' ),
			),
			array(
				'type' => 'textfield',
				'heading' => __( 'Lightbox Dimensions', 'tb' ),
				'param_name' => 'lightbox_dimensions',
				'description' => __( 'Enter a custom width and height for your lightbox pop-up window. Use format widthxheight. Example: 900x600.', 'tb' ),
				'group' => __( 'Lightbox', 'tb' ),
				'dependency' => Array( 'element' => 'lightbox', 'value' => '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' => __( 'Icons', 'tb' ),
			),
			array(
				'type' => 'iconpicker',
				'heading' => __( 'Icon Left', 'tb' ),
				'param_name' => 'icon_left',
				'admin_label' => true,
				'settings' => array(
					'emptyIcon' => true,
					'iconsPerPage' => 200,
				),
				'dependency' => array(
					'element' => 'icon_type',
					'value' => 'fontawesome',
				),
				'group' => __( 'Icons', 'tb' ),
			),
			array(
				'type' => 'iconpicker',
				'heading' => __( 'Icon Left', 'tb' ),
				'param_name' => 'icon_left_openiconic',
				'settings' => array(
					'emptyIcon' => true,
					'type' => 'openiconic',
					'iconsPerPage' => 200,
				),
				'dependency' => array(
					'element' => 'icon_type',
					'value' => 'openiconic',
				),
				'group' => __( 'Icons', 'tb' ),
			),
			array(
				'type' => 'iconpicker',
				'heading' => __( 'Icon Left', 'tb' ),
				'param_name' => 'icon_left_typicons',
				'settings' => array(
					'emptyIcon' => true,
					'type' => 'typicons',
					'iconsPerPage' => 200,
				),
				'dependency' => array(
					'element' => 'icon_type',
					'value' => 'typicons',
				),
				'group' => __( 'Icons', 'tb' ),
			),
			array(
				'type' => 'iconpicker',
				'heading' => __( 'Icon Left', 'tb' ),
				'param_name' => 'icon_left_entypo',
				'settings' => array(
					'emptyIcon' => true,
					'type' => 'entypo',
					'iconsPerPage' => 300,
				),
				'dependency' => array(
					'element' => 'icon_type',
					'value' => 'entypo',
				),
				'group' => __( 'Icons', 'tb' ),
			),
			array(
				'type' => 'iconpicker',
				'heading' => __( 'Icon Left', 'tb' ),
				'param_name' => 'icon_left_linecons',
				'settings' => array(
					'emptyIcon' => true,
					'type' => 'linecons',
					'iconsPerPage' => 200,
				),
				'dependency' => array(
					'element' => 'icon_type',
					'value' => 'linecons',
				),
				'group' => __( 'Icons', 'tb' ),
			),
			array(
				'type' => 'iconpicker',
				'heading' => __( 'Icon Left', 'tb' ),
				'param_name' => 'icon_left_pixelicons',
				'settings' => array(
					'emptyIcon' => true,
					'type' => 'pixelicons',
					'source' => vcex_pixel_icons(),
				),
				'dependency' => array(
					'element' => 'icon_type',
					'value' => 'pixelicons',
				),
				'group' => __( 'Icons', 'tb' ),
			),
			array(
				'type' => 'iconpicker',
				'heading' => __( 'Icon Right', 'tb' ),
				'param_name' => 'icon_right',
				'admin_label' => true,
				'settings' => array(
					'emptyIcon' => true,
					'iconsPerPage' => 200,
				),
				'dependency' => array(
					'element' => 'icon_type',
					'value' => 'fontawesome',
				),
				'group' => __( 'Icons', 'tb' ),
			),
			array(
				'type' => 'iconpicker',
				'heading' => __( 'Icon Right', 'tb' ),
				'param_name' => 'icon_right_openiconic',
				'settings' => array(
					'emptyIcon' => true,
					'type' => 'openiconic',
					'iconsPerPage' => 200,
				),
				'dependency' => array(
					'element' => 'icon_type',
					'value' => 'openiconic',
				),
				'group' => __( 'Icons', 'tb' ),
			),
			array(
				'type' => 'iconpicker',
				'heading' => __( 'Icon Right', 'tb' ),
				'param_name' => 'icon_right_typicons',
				'settings' => array(
					'emptyIcon' => true,
					'type' => 'typicons',
					'iconsPerPage' => 200,
				),
				'dependency' => array(
					'element' => 'icon_type',
					'value' => 'typicons',
				),
				'group' => __( 'Icons', 'tb' ),
			),
			array(
				'type' => 'iconpicker',
				'heading' => __( 'Icon Right', 'tb' ),
				'param_name' => 'icon_right_entypo',
				'settings' => array(
					'emptyIcon' => true,
					'type' => 'entypo',
					'iconsPerPage' => 300,
				),
				'dependency' => array(
					'element' => 'icon_type',
					'value' => 'entypo',
				),
				'group' => __( 'Icons', 'tb' ),
			),
			array(
				'type' => 'iconpicker',
				'heading' => __( 'Icon Right', 'tb' ),
				'param_name' => 'icon_right_linecons',
				'settings' => array(
					'emptyIcon' => true,
					'type' => 'linecons',
					'iconsPerPage' => 200,
				),
				'dependency' => array(
					'element' => 'icon_type',
					'value' => 'linecons',
				),
				'group' => __( 'Icons', 'tb' ),
			),
			array(
				'type' => 'iconpicker',
				'heading' => __( 'Icon Right', 'tb' ),
				'param_name' => 'icon_right_pixelicons',
				'settings' => array(
					'emptyIcon' => true,
					'type' => 'pixelicons',
					'source' => vcex_pixel_icons(),
				),
				'dependency' => array(
					'element' => 'icon_type',
					'value' => 'pixelicons',
				),
				'group' => __( 'Icons', 'tb' ),
			),
			array(
				'type' => 'textfield',
				'heading' => __( 'Left Icon: Right Padding', 'tb' ),
				'param_name' => 'icon_left_padding',
				'group' => __( 'Icons', 'tb' ),
			),

			array(
				'type' => 'textfield',
				'heading' => __( 'Right Icon: Left Padding', 'tb' ),
				'param_name' => 'icon_right_padding',
				'group' => __( 'Icons', 'tb' ),
			),
		)
	) );
}
add_action( 'vc_before_init', 'vcex_button_vc_map' );