<?php
/*===============================
Shortocde tz-skill-item
===============================*/

function tzinteriart_bg_image($atts) {
   $tz_simple_image = '';
    extract(shortcode_atts(array(
        'tz_simple_image'              => '',
    ),$atts));
    ob_start();

    $tz_img_id = preg_replace( '/[^\d]/', '', $tz_simple_image);
    $tz_width_img ='';
    $tz_height_img ='';
    $tz_images_info = wp_get_attachment_image_src($tz_img_id, $size='full');
    if(isset($tz_images_info) && !empty($tz_images_info)){
        $tz_url_img = $tz_images_info[0];
        $tz_width_img = $tz_images_info[1];
        $tz_height_img = $tz_images_info[2];
    }

    $tzinteriart_class1 = '';

    if($tz_type_bg != ''){
        $tzinteriart_class1 .= 'tz-bg-type-'.$tz_type_bg;
    }
    ?>
    <div class="tz_simple_image <?php echo esc_attr($tzinteriart_class1);?>">
        <?php
        if(tz_bg_image != ''){
            ?>
            <div class="tz_image_item">
                <img width="<?php echo esc_attr($tz_width_img);?>" height="<?php echo esc_attr($tz_height_img);?>" alt="<?php echo esc_attr($tz_name);?>" src="<?php echo esc_url($tz_url_img);?>">
            </div>
            <?php
        }
        ?>

        <?php
        if($tz_type == '1' && $tz_subtitle != ''){
            ?>

            <?php
        }
        ?>


    </div>
    <?php
    return ob_get_clean();
}
add_shortcode('tz-simple-image','tzinteriart_bg_image');
?>
