Skip to content

Commit

Permalink
2024 Theme: Add alt text to fallback featured images
Browse files Browse the repository at this point in the history
See #2482
  • Loading branch information
adamwoodnz committed Jul 24, 2024
1 parent a08d9ae commit cce4f34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wp-content/themes/pub/wporg-learn-2024/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ function set_site_breadcrumbs( $breadcrumbs ) {
*/
function set_default_featured_image( $html, $post_id, $post_thumbnail_id, $size, $attr ) {
if ( ! $html ) {
return '<img src="https://s.w.org/images/learn-thumbnail-fallback.jpg?v=4" alt="" />';
return '<img src="https://s.w.org/images/learn-thumbnail-fallback.jpg?v=4" alt="' . esc_attr( get_the_title( $post_id ) ) . '" />';
}

return $html;
Expand Down

0 comments on commit cce4f34

Please sign in to comment.