<?php
$dir_type = plugin_dir_url( __FILE__ );
vc_add_shortcode_param( 'tzpreview', 'tzpreview_settings_field' );
function tzpreview_settings_field( $settings, $value ) {
    return '<div class="tzpreview_block">'
        .'<input name="' . esc_attr( $settings['param_name'] ) . '" class="wpb_vc_param_valueup wpb_vc_param_value wpb-textinput ' .
        esc_attr( $settings['param_name'] ) . ' ' .
        esc_attr( $settings['type'] ) . '_field" type="hidden" value="' . esc_attr( $value ) . '" />' .
        '<img class="vc_preview ' . esc_attr( $settings['param_name'] ) . ' '. esc_attr( $settings['type'] ) . '_field" src="' . esc_url( $value ) . '" /></div>';
}