%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/gachan/www/wp-content/plugins/jekas_extensions/vc_extended/shortcodes/
Upload File :
Create Path :
Current File : /home/gachan/www/wp-content/plugins/jekas_extensions/vc_extended/shortcodes/vc_promotion.php

<?php
add_action('vc_before_init','jekas_add_vc_promotion');
if(!function_exists('jekas_add_vc_promotion')){
 function jekas_add_vc_promotion(){
  vc_map(array(
               'name'=>__( 'Promotion', 'jekas' ),
               'base'=> 'vc_promotion',
			   'icon' => 'jekas fa fa-star',
              'category' => esc_html__( 'Jekas Options', 'jekas' ),
               'description'=>__( 'Promotion', 'jekas' ),
               'params'=>array(
                               array(
                                   'type'=>'textfield',
                                     'heading'=>__( 'Title', 'jekas' ),
                                     'param_name'=>'title',
                                     'value'=>'',
                                     ),
                               array('type'=>'textfield',
                                     'heading'=>__( 'Text resalted', 'jekas' ),
                                     'param_name'=>'text_resalted',
                                     'value'=>'',
                                     'description'=>__( 'Text into title that will be resalted ', 'jekas' ),
                                     ),
                                array('type'=>'textarea',
                                     'heading'=>__( 'Slogan', 'jekas' ),
                                     'param_name'=>'slogan',
                                     'value'=>'',
                                     ),
                   array(
			            'type' => 'iconpicker',
			            'heading' => esc_html__( 'Icon Left', 'jekas' ),
			            'param_name' => 'icon_left',
			            'value' => '',            
			             'description' => esc_html__( 'Select icon from library.', 'jekas' ),
		                   ),
                              array(
			            'type' => 'iconpicker',
			            'heading' => esc_html__( 'Icon Right', 'jekas' ),
			            'param_name' => 'icon_right',
			            'value' => '',            
			            'description' => esc_html__( 'Select icon from library.', 'jekas' ),
		                   ),
		              array('type'=>'checkbox',
                                     'heading'=>__( 'Line Vertical Top', 'jekas' ),
                                     'param_name'=>'line_vertical_top',
                                     'value'=>array( esc_html__( 'Yes, please', 'jekas' ) => '1'),
                                     ), 
                                array('type'=>'checkbox',
                                     'heading'=>__( 'Line Vertical Bottom', 'jekas' ),
                                     'param_name'=>'line_vertical_bottom',
                                     'value'=>array( esc_html__( 'Yes, please', 'jekas' ) => '1'),
                                     ),       
                              ),
                             ));
  
  }
}

  function vc_promotion_tpl($atts,$content=''){

      $title = $text_resalted = $slogan = $icon_left = $icon_right = $line_vertical_top = $line_vertical_bottom = '';

    extract(shortcode_atts(array(
        'title'=>'',
        'text_resalted'=>'',
        'slogan'=>'',
        'icon_left'=>'',
        'icon_right'=>'',
        'line_vertical_top'=>false,
        'line_vertical_bottom'=>false,
        ),$atts));

    $output='';
    if($line_vertical_top==1)
    $output.='<div class="vertical_line">
                    <div class="circle_bottom"></div>
                </div>';
    $output.='<div class="info_vertical animated">';
    $output.='<h2 class="text_h1">'.str_replace($text_resalted,"<span>$text_resalted</span>",$title).'</h2>';
    $output.='<p>'.$slogan.'</p>';
    $output.='</div>';
    
    if($line_vertical_bottom==1)
    $output.='<div class="vertical_line"></div>';
    
    if(!empty($icon_left))
     $output.='<i class="'.$icon_left.' left"></i>';
    if(!empty($icon_right))
     $output.='<i class="'.$icon_right.' right"></i>';
           
 return $output;
}
add_shortcode('vc_promotion','vc_promotion_tpl');
?>

Zerion Mini Shell 1.0