<?php
add_filter( 'em_event_output_placeholder', 'em_event_image_alt', 100, 3 );
function em_event_image_alt( $replace, $EM_Event, $result ) {
if ( $result === '#_EVENTIMAGECUSTOM' ) {
$image_id = get_post_thumbnail_id( $EM_Event->post_id );
if ( $image_id ) {
$alt = get_post_meta( $image_id, '_wp_attachment_image_alt', true );
$replace = wp_get_attachment_image(
$image_id,
'medium',
false,
array( 'alt' => $alt )
);
}
}
return $replace;
}