Wordpress is stripping the Alt tag's quote marks from images where Alt is not set, but leaving the word 'alt' creating problems for ADA compliance

wordpress.stackexchange https://wordpress.stackexchange.com/questions/387026

  •  26-04-2021
  •  | 
  •  

문제

How do I get around this? For ADA compliance I specifically need alt="" on some of my images in a wordpress site, however wordpress is stripping the Alt tag's quote marks from images where Alt is not set, and just leaving the word 'alt' without the quotation marks. How do I make sure the Alt tags are left intact with their quote marks? I just need it to say alt="" instead of alt. ! :D

도움이 되었습니까?

해결책

I tried to replicate your issue and while the dev tools show it as alt the source code shows alt="", so WordPress is not stripping the quotes, it's just the dev tools being concise. But even if it was, they're equivalent so alt and alt="" are the same.

As for why the dev tools display alt, it's because the dev tools don't display the HTML, they display the DOM

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 wordpress.stackexchange
scroll top