Please help me, how should I modify this line?
$new_name = preg_replace('/[^A-Za-z0-9._ ]/i', '-', basename($lowrez));
Above code can be replaced by a single line
add_filter( 'wp_get_attachment_image_attributes', 'qtrans_useCurrentLanguageIfNotFoundShowAvailable', 0 );
Issue with the caption is still open.
I’m using this function in the functions.php for title and alt
function my_image_titles($atts,$img) {
$atts['title'] = __( $img->post_excerpt );
$atts['alt'] = __( $img->post_content );
return $atts;
}
add_filter('wp_get_attachment_image_attributes','my_image_titles',10,2);
Help, how to do such thing with image caption.