Making WordPress.org

Changeset 12989


Ignore:
Timestamp:
11/30/2023 09:06:45 PM (12 months ago)
Author:
coffee2code
Message:

Photo Directory, Posts: Improve accessibility of photos in the feed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/posts.php

    r12987 r12989  
    414414        global $post;
    415415
     416        $content = trim( strip_tags( $content ) );
     417
    416418        if ( $post && Registrations::get_post_type() === get_post_type( $post ) && has_post_thumbnail( $post->ID ) ) {
    417419            $content = '<figure>'
     420                . get_the_post_thumbnail( $post->ID, self::RSS_PHOTO_SIZE, [ 'alt' => $content, 'style' => 'margin-bottom: 10px;', 'srcset' => ' ' ] ) . "\n"
    418421                . get_the_post_thumbnail( $post->ID, self::RSS_PHOTO_SIZE, [ 'style' => 'margin-bottom: 10px;', 'srcset' => ' ' ] ) . "\n"
    419                 . ( $content ? "<figcaption>{$content}</figcaption>\n" : '' )
     422                . ( $content ? "<figcaption aria-hidden=\"true\">{$content}</figcaption>\n" : '' )
    420423                . "</figure>\n";
    421424        }
Note: See TracChangeset for help on using the changeset viewer.