<?
add_filter('wp_get_attachment_image_attributes', 'change_attachement_image_attributes', 20, 2);
function change_attachement_image_attributes($attr, $attachment) {
global $post;
if ($post->post_type == 'product') {
$title = $post->post_title;
static $num = 0;
$num++;
$attr['alt'] = sprintf("Фото %d - %s.",$num,$title);
}
return $attr;
}