{"id":59,"date":"2022-10-30T18:28:16","date_gmt":"2022-10-30T18:28:16","guid":{"rendered":"https:\/\/docs.joedolson.com\/wp-accessibility\/?p=59"},"modified":"2022-10-30T18:28:24","modified_gmt":"2022-10-30T18:28:24","slug":"alt-text-enforcement","status":"publish","type":"post","link":"https:\/\/docs.joedolson.com\/wp-accessibility\/2022\/10\/30\/alt-text-enforcement\/","title":{"rendered":"Alt text enforcement"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">WP Accessibility contains a number of ways to help enforce the use of alt attributes in post content.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the classic editor, images with alt text that is either suspicious or missing will be shown with a label indicating that the image is missing alt text. If the &#8216;decorative image&#8217; toggle is checked, this rule will be ignored.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"425\" height=\"309\" src=\"https:\/\/docs.joedolson.com\/wp-accessibility\/wp-content\/uploads\/sites\/11\/2022\/10\/image-1.png\" alt=\"\" class=\"wp-image-60\" srcset=\"https:\/\/docs.joedolson.com\/wp-accessibility\/wp-content\/uploads\/sites\/11\/2022\/10\/image-1.png 425w, https:\/\/docs.joedolson.com\/wp-accessibility\/wp-content\/uploads\/sites\/11\/2022\/10\/image-1-300x218.png 300w\" sizes=\"auto, (max-width: 425px) 100vw, 425px\" \/><figcaption class=\"wp-element-caption\">Example showing the alt text missing label in the classic editor.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Block Editor<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In the block editor, the decorative image label doesn&#8217;t have an effect, although it will still be saved as a marker in your media library. All images without alt text will be indicated in the block editor.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"673\" height=\"442\" src=\"https:\/\/docs.joedolson.com\/wp-accessibility\/wp-content\/uploads\/sites\/11\/2022\/10\/image-3.png\" alt=\"\" class=\"wp-image-62\" srcset=\"https:\/\/docs.joedolson.com\/wp-accessibility\/wp-content\/uploads\/sites\/11\/2022\/10\/image-3.png 673w, https:\/\/docs.joedolson.com\/wp-accessibility\/wp-content\/uploads\/sites\/11\/2022\/10\/image-3-300x197.png 300w\" sizes=\"auto, (max-width: 673px) 100vw, 673px\" \/><figcaption class=\"wp-element-caption\">Alt text missing in the block editor.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Browser Support<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The attribute labeling here depends on the <code>:has<\/code> selector in CSS, which is not supported in IE11 at this time. In Firefox, it is available but depends on enabling the <code>layout.css.has-selector.enabled<\/code> feature flag. In unsupported browsers, only the outline will be visible, and not the text label.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WP Accessibility contains a number of ways to help enforce the use of alt attributes in post content. In the classic editor, images with alt text that is either suspicious or missing will be shown with a label indicating that the image is missing alt text. If the &#8216;decorative image&#8217; toggle is checked, this rule [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-59","post","type-post","status-publish","format-standard","hentry","category-features"],"_links":{"self":[{"href":"https:\/\/docs.joedolson.com\/wp-accessibility\/wp-json\/wp\/v2\/posts\/59","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.joedolson.com\/wp-accessibility\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.joedolson.com\/wp-accessibility\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.joedolson.com\/wp-accessibility\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.joedolson.com\/wp-accessibility\/wp-json\/wp\/v2\/comments?post=59"}],"version-history":[{"count":1,"href":"https:\/\/docs.joedolson.com\/wp-accessibility\/wp-json\/wp\/v2\/posts\/59\/revisions"}],"predecessor-version":[{"id":64,"href":"https:\/\/docs.joedolson.com\/wp-accessibility\/wp-json\/wp\/v2\/posts\/59\/revisions\/64"}],"wp:attachment":[{"href":"https:\/\/docs.joedolson.com\/wp-accessibility\/wp-json\/wp\/v2\/media?parent=59"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.joedolson.com\/wp-accessibility\/wp-json\/wp\/v2\/categories?post=59"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.joedolson.com\/wp-accessibility\/wp-json\/wp\/v2\/tags?post=59"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}