• Resolved maxidavis

    (@maxidavis)


    Hi there,

    where can I set the alt tag of the image? I inserted it inside the media library but the tag remains empty.

    Thanks, Max

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author pepe

    (@pputzer)

    Hi! That’s not something that is handled by Avatar Privacy but rather by WordPress Core. That said, I think you could try to filter the get_avatar_data hook and add the alt attribute string to extra_args.

    Addendum: There’s some discussion on whether alt texts for purely decorative images like avatars (in comments and such the author information is already there in text format) are a meaningful accessibility improvement, or might even be reducing accessibility for screen reader users.

    • This reply was modified 2 years, 1 month ago by pepe.
    Thread Starter maxidavis

    (@maxidavis)

    Okay, so there is no direct setting? Then at least I haven’t overlooked anything.
    Yes, that’s a good point. But I wouldn’t call it a decorative element, because the author image is very present.
    What would the code for the functions.php be exactly?

    Plugin Author pepe

    (@pputzer)

    Sorry, I haven’t actually written a function for this. Since it is not directly related to Avatar Privacy, you may have better luck in the general WP support forums here.

    Regarding accessibility, I’d argue the author image is purely decorative in most cases as it does not add any additional information for users of screen readers (unless you are actually describing the image content in your alt tag – though I still maintain that letting a screen reader read you the comments section of a post is a better experience without alt attributes for each commenter’s avatar even in that case.

    Thread Starter maxidavis

    (@maxidavis)

    Okay, too bad. I would still be happy if there was an option to alt-tag your own avatar image in the future.
    As I said, for me it’s not a decorative element, but I use it to display my author image and not in the comments. That’s why I need it.

    Plugin Author pepe

    (@pputzer)

    Well, in that case you could simply add it in your theme’s templates. In any case, it is out of scope for Avatar Privacy (as the plugin simply does not touch the relevant part of Core’s avatar handling). The only part where it could possibly in scope is for local avatars uploaded via Avatar Privacy. However, as long as Core does not use the alt attribute, what use would adding the field for one specific type of avatars be?

    If you have a specific proposal how such a feature could work, I am willing to listen, but it is probably not something I’ll pursue on my own.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘alt tag’ is closed to new replies.