%PDF- %PDF-
| Direktori : /home/gachan/www/wp-content/plugins/jekas_extensions/vc_extended/shortcodes/ |
| Current File : /home/gachan/www/wp-content/plugins/jekas_extensions/vc_extended/shortcodes/jekas_link.php |
<?php
add_action('vc_before_init','jekas_add_link');
if(!function_exists('jekas_add_link')){
function jekas_add_link(){
vc_map(array('name' => esc_html__( 'Jk Link', 'jekas' ),
'base' => 'jekas_link',
'content_element'=>true,
'icon' => 'jekas fa fa-external-link',
'category' => esc_html__( 'Jekas Options', 'jekas' ),
'description' => esc_html__( 'Ul list container', 'jekas' ),
'params'=>array(
array(
'type'=>'textfield',
'heading' => esc_html__( 'Text', 'jekas' ),
'param_name'=>'text',
'value'=>'',
'description'=>__( 'Text on the link.', 'jekas' ),
),
array(
'type'=>'textfield',
'heading' => esc_html__( 'Link', 'jekas' ),
'param_name'=>'link',
'value'=>'',
'description'=>__( 'Url.', 'jekas' ),
),
array(
'type'=>'textfield',
'heading' => esc_html__( 'Extraclass name ', 'jekas' ),
'param_name'=>'e_class',
'value'=>'',
'description'=>__( 'Class of css.', 'jekas' ),
),
array(
'type' => 'iconpicker',
'heading' => esc_html__( 'Icon', 'jekas' ),
'param_name' => 'icon',
'value' => '',
'dependency' => array(
'element' => 'type',
'value' => 'fontawesome',
),
'description' => esc_html__( 'Select icon from library.', 'jekas' ),
),
array(
'type'=>'colorpicker',
'heading' => esc_html__( 'Color ', 'jekas' ),
'param_name'=>'icon_color',
'value'=>'',
'description'=>__( 'Icon color.', 'jekas' ),
),
),
)
);
}
}
function jekas_link_render($atts,$content){
$text = $link = $e_class = $icon = $icon_color = '';
extract(shortcode_atts(array(
'text'=>'',
'link'=>'',
'e_class'=>'',
'icon'=>'',
'icon_color'=>'',
),$atts ));
if(empty($link))
$link='#' ;
$output='<a href="'.esc_url($link).'" class="'.esc_attr($e_class).'"><span><i class="'.$icon.'" ';
if(!empty($icon_color))
$output.='style="color:'.$icon_color.'" ';
$output.=' ></i>'.esc_html($text).'</span></a>';
return $output;
}
add_shortcode('jekas_link','jekas_link_render');
?>