%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_image.php

<?php
add_action('vc_before_init','jekas_add_vc_image');
if(!function_exists('jekas_add_vc_image')){
 function jekas_add_vc_image(){
  vc_map(array(
               'name'=>__( 'Image', 'jekas' ),
               'base'=> 'vc_image',
			   'icon' => 'jekas fa fa-image',
              'category' => esc_html__( 'Jekas Options', 'jekas' ),
               'description'=>__( 'Image', 'jekas' ),
               'params'=>array(
                                array(
		                   'type' => 'attach_image',
			           'heading' => esc_html__( 'Image', 'jekas' ),
			           'param_name' => 'image',
			           'value' => '',
			           'description' => esc_html__( 'Select images from media library.', 'jekas' )
		                  ), 
                                 array('type'=>'textfield',
                                     'heading'=>__( 'Extra class name', 'jekas' ),
                                     'param_name'=>'e_class',
                                     'value'=>'',
                                     ),    
                              ),
                             ));
  
  }
}

  function vc_image_render($atts,$content=''){
      $image= $e_class = '';
    extract(shortcode_atts(array(
        'image'=>'',
        'e_class'=>'',
        ),$atts));
    $output='';
    if(!empty($image))
    $output='<img src="'.wp_get_attachment_url($image).'" class="'.$e_class.'" alt=""/>';

   return $output;
  }
add_shortcode('vc_image','vc_image_render');
?>

Zerion Mini Shell 1.0