Skip to content

Commit

Permalink
Fix incorrectly fetched alt attribute
Browse files Browse the repository at this point in the history
Invalid function chaining
  • Loading branch information
joedolson committed Jul 23, 2024
1 parent 132c91e commit 46e083b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/my-calendar-output.php
Original file line number Diff line number Diff line change
Expand Up @@ -750,9 +750,10 @@ function mc_get_event_image( $event, $data, $size = '' ) {
*
* @return {array}
*/
$atts = apply_filters( 'mc_post_thumbnail_atts', array( 'class' => 'mc-image photo' ), $event );
if ( ! isset( $atts['alt'] ) && ! get_post_meta( get_post_thumbnail_id( $event->event_post, '_wp_attachment_image_alt', true ) ) ) {
$atts['alt'] = $event->post_title;
$atts = apply_filters( 'mc_post_thumbnail_atts', array( 'class' => 'mc-image photo' ), $event );
$thumbnail_id = get_post_thumbnail_id( $event->event_post );
if ( ! isset( $atts['alt'] ) && ! get_post_meta( $thumbnail_id, '_wp_attachment_image_alt', true ) ) {
$atts['alt'] = $event->event_title;
}
$image = get_the_post_thumbnail( $event->event_post, $default_size, $atts );
} else {
Expand Down

0 comments on commit 46e083b

Please sign in to comment.