????
| 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/navbar.php |
<?php
/**
* Visual Composer Navbar
*
* @package Wanderfuls WordPress Theme
* @subpackage VC Functions
* @version 3.0.0
*/
/**
* Register shortcode with VC Composer
*
* @since 2.0.0
*/
class WPBakeryShortCode_vcex_navbar extends WPBakeryShortCode {
protected function content( $atts, $content = null ) {
ob_start();
include( locate_template( 'vcex_templates/vcex_navbar.php' ) );
return ob_get_clean();
}
}
/**
* Adds the shortcode to the Visual Composer
*
* @since 1.4.1
*/
function vcex_navbar_vc_map() {
// Create an array of menu items
$menus_array = array( __( 'None', 'tb' ) => '' );
if ( is_admin() ) {
$menus = get_terms( 'nav_menu', array( 'hide_empty' => true ) );
foreach ( $menus as $menu) {
$menus_array[$menu->name] = $menu->term_id;
}
}
// Map the shortcode
vc_map( array(
'name' => __( 'Navigation Bar', 'tb' ),
'description' => __( 'Custom menu navigation bar', 'tb' ),
'base' => 'vcex_navbar',
'icon' => 'vcex-navbar vcex-icon fa fa-navicon',
'category' => TB_THEME_BRANDING,
'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',
'admin_label' => true,
'heading' => __( 'Menu', 'tb' ),
'param_name' => 'menu',
'std' => '',
'value' => $menus_array,
'save_always' => true,
),
array(
'type' => 'dropdown',
'heading' => __( 'Alignment', 'tb' ),
'param_name' => 'align',
'value' => array_flip( tb_alignments() ),
),
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() ),
'std' => '',
),
array(
'type' => 'dropdown',
'heading' => __( 'Local Scroll menu', 'tb'),
'param_name' => 'local_scroll',
'value' => array(
__( 'No', 'tb' ) => 'false',
__( 'Yes', 'tb' ) => 'true',
),
),
// Design
array(
'type' => 'dropdown',
'admin_label' => true,
'heading' => __( 'Style', 'tb' ),
'param_name' => 'style',
'std' => 'buttons',
'group' => __( 'Design', 'tb' ),
'value' => array(
__( 'Buttons', 'tb' ) => 'buttons',
__( 'Simple', 'tb' ) => 'simple',
),
),
array(
'type' => 'dropdown',
'heading' => __( 'Button Style', 'tb' ),
'param_name' => 'button_style',
'value' => array_flip( tb_button_styles() ),
'group' => __( 'Design', 'tb' ),
'std' => 'minimal-border',
'dependency' => Array( 'element' => 'style', 'value' => 'buttons' ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Button Color', 'tb' ),
'param_name' => 'button_color',
'std' => '',
'value' => array_flip( tb_button_colors() ),
'group' => __( 'Design', 'tb' ),
'dependency' => Array( 'element' => 'style', 'value' => 'buttons' ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Layout', 'tb' ),
'param_name' => 'button_layout',
'value' => array(
__( 'Default', 'tb' ) => '',
__( 'Expanded', 'tb' ) => 'expanded',
),
'group' => __( 'Design', 'tb' ),
'dependency' => Array( 'element' => 'style', 'value' => 'buttons' ),
),
array(
'type' => 'textfield',
'heading' => __( 'Font Size', 'tb' ),
'param_name' => 'font_size',
'group' => __( 'Design', 'tb' ),
),
array(
'type' => 'dropdown',
'heading' => __( 'Color', 'tb' ) .' ('. _x( 'Legacy', 'Old VC Module Setting', 'tb' ) .')',
'param_name' => 'link_color',
'value' => array(
__( 'Default', 'tb' ) => '',
__( 'Black', 'tb' ) => 'black',
__( 'White', 'tb' ) => 'white',
),
'group' => __( 'Design', 'tb' ),
),
array(
'type' => 'colorpicker',
'heading' => __( 'Hover: Background', 'tb' ),
'param_name' => 'hover_bg',
'group' => __( 'Design', 'tb' ),
),
array(
'type' => 'colorpicker',
'heading' => __( 'Hover: Color', 'tb' ),
'param_name' => 'hover_color',
'group' => __( 'Design', 'tb' ),
),
// Advanced Styling
array(
'type' => 'css_editor',
'heading' => __( 'CSS', 'tb' ),
'param_name' => 'css',
'group' => __( 'CSS', 'tb' ),
),
// Deprecated params
array(
'type' => 'hidden',
'param_name' => 'border_radius',
),
)
) );
}
add_action( 'vc_before_init', 'vcex_navbar_vc_map' );