Make WordPress Core

Opened 9 days ago

Last modified 4 days ago

#61956 assigned defect (bug)

Convert div to main tag for web accessibility

Reported by: upendmca's profile upendmca Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Themes Keywords: has-patch reporter-feedback close
Focuses: accessibility Cc:

Description (last modified by sabernhardt)

How to convert <div class="wp-site-blocks">Content</div> to <main class="wp-site-blocks">Content</main> in gutenberg block template.
This is coming from wp-includes folder block-template.php.

Change History (7)

#1 @sabernhardt
9 days ago

  • Component changed from General to Themes
  • Description modified (diff)
  • Focuses accessibility added

This ticket was mentioned in PR #7274 on WordPress/wordpress-develop by @narenin.


8 days ago
#2

  • Keywords has-patch added

#3 @upendmca
8 days ago

  • Keywords has-testing-info added

Hi @narenin

I have tested the patch and it is working fine.

Test Report

Environment:

OS: Windows
PHP: 8.2.12
WordPress: 6.6.1
Browser: Chrome
Theme: Twenty Twenty-One (Version: 2.3)
Plugins: None activated

Actual Results:

✅ Patch working well as desired solution.

#4 @sabernhardt
8 days ago

  • Keywords reporter-feedback added; has-testing-info removed

Hi and welcome to WordPress Core Trac!

Could you explain how you want to use the wp-site-blocks wrapper?

Twenty Twenty-One:

  • is not a block-based theme, so it does not output a wp-site-blocks wrapper
  • already has a <main> element

A document must only have one main element (unless additional main elements are hidden). MDN docs

Related: GB35354

@narenin commented on PR #7274:


5 days ago
#5

@mukeshpanchal27 Thanks for the feedback, I have implemented them, please check.

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.


4 days ago

#7 @joedolson
4 days ago

  • Keywords close added

At this time, this change seems unnecessary. I think that the use case would be if you were attempting to child theme a parent that did not use the main element in its templates. In that case, you could use this filter to change the outer wrapper instead of editing the templates in your child theme.

However, block themes in the theme repository are expected to include a main element; the main element is available on relevant blocks as a selectable HTML element in the advanced block settings; and you can change them in child themes (even if it's kind of a pain.)

I think this is probably a wontfix issue; but I'm open to arguments, if there's a case I haven't thought of.

Discussed in the accessibility bug scrub, and agreed.

Note: See TracTickets for help on using tickets.