Skip to content

Commit

Permalink
Post Featured Image: Only get the post title when rendering alt text (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka authored Nov 17, 2022
1 parent dbb9487 commit fecc1d2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/block-library/src/post-featured-image/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ function render_block_core_post_featured_image( $attributes, $content, $block )

$is_link = isset( $attributes['isLink'] ) && $attributes['isLink'];
$size_slug = isset( $attributes['sizeSlug'] ) ? $attributes['sizeSlug'] : 'post-thumbnail';
$post_title = trim( strip_tags( get_the_title( $post_ID ) ) );
$attr = get_block_core_post_featured_image_border_attributes( $attributes );
$overlay_markup = get_block_core_post_featured_image_overlay_element_markup( $attributes );

if ( $is_link ) {
$attr['alt'] = $post_title;
$attr['alt'] = trim( strip_tags( get_the_title( $post_ID ) ) );
}

if ( ! empty( $attributes['height'] ) ) {
Expand Down

0 comments on commit fecc1d2

Please sign in to comment.