| Server IP : 213.186.33.4 / Your IP : 216.73.216.222 Web Server : Apache System : Linux webm005.cluster103.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64 User : karinebmkh ( 644538) PHP Version : 8.4.22 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/karinebmkh/www2/wp-content/themes/thevoux-wp/vc_templates/ |
Upload File : |
<?php function thb_image( $atts, $content = null ) {
$atts = vc_map_get_attributes( 'thb_image', $atts );
extract( $atts );
$img_id = preg_replace('/[^\d]/', '', $image);
$full = $full_width == 'true' ? 'full' : '';
$img_size = $img_size == '' ? 'full' : $img_size;
$img = wpb_getImageBySize( array( 'attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => 'thb_image ' . $animation . ' ' . $alignment . ' '. $full . ' ' . $retina ) );
if ( $img == NULL ) $img['thumbnail'] = '<img src="http://placekitten.com/g/400/300" />';
$link_to = $c_lightbox = $a_title = $a_target = '';
if ($lightbox == true) {
$link_to = wp_get_attachment_image_src( $img_id, 'large');
$link_to = $link_to[0];
$c_lightbox = ' rel="magnific"';
} else {
$img_link = ( $img_link == '||' ) ? '' : $img_link;
$link = vc_build_link( $img_link );
$link_to = $link['url'];
$a_title = $link['title'];
$a_target = $link['target'];
}
if (!empty($link_to)) {
$out = '<a class="image_link"'.$c_lightbox.' href="'.$link_to.'"'. ' target="'.sanitize_text_field( $a_target ).'" title="'.$a_title.'">'.$img['thumbnail'].'</a>';
} else {
$out = $img['thumbnail'];
}
return $out;
}
thb_add_short('thb_image', 'thb_image');