/** * LazyestFrontendFolder::thumb_caption() * * @uses apply_filters * @since 1.1.0 * @param LazyestThumb $image * @return string html code of caption */ function thumb_caption($image) { global $lg_gallery; $thumb_caption = '<div class="lg_thumb_caption">'; $caption = $image->caption(); $max_length = (int) $lg_gallery->get_option('captions_length'); if ('0' != $lg_gallery->get_option('captions_length')) { if (strlen($caption) > $max_length) { strip_tags($caption); $caption = substr($caption, 0, $max_length - 1) . '…'; } } $thumb_caption .= sprintf('<span title="%s" >%s</span>', $image->title(), lg_html($caption)); $thumb_caption .= '</div>'; if ('TRUE' == $lg_gallery->get_option('thumb_description')) { if ('' != $image->description) { $thumb_caption .= sprintf('<div class="thumb_description"><p>%s</p></div>', lg_html($image->description())); } $thumb_caption .= apply_filters('lazyest_thumb_description', '', $image); } return $thumb_caption; }