if ( $instance['alt'
] ) { $image_attributes['alt'
] =
$instance['alt'
];
} $size =
$instance['size'
];
if ( 'custom' ===
$size || !
in_array( $size,
array_merge( get_intermediate_image_sizes(), array
( 'full'
) ), true
) ) { $size = array
( $instance['width'
],
$instance['height'
] );
$width =
$instance['width'
];
} else { $caption_size =
_wp_get_image_size_from_meta( $instance['size'
],
wp_get_attachment_metadata( $attachment->ID
) );
$width =
empty( $caption_size[0
] ) ? 0 :
$caption_size[0
];
} $image_attributes['class'
] .=
sprintf( ' attachment-%1$s size-%1$s',
is_array( $size ) ?
implode( 'x',
$size ) :
$size );
$image =
wp_get_attachment_image( $attachment->ID,
$size, false,
$image_attributes );
} else { if ( empty( $instance['url'
] ) ) { return;
}