[wp-trac] [WordPress Trac] #56496: Twenty Twenty-Two: Update comment block markup
WordPress Trac
noreply at wordpress.org
Fri Oct 14 17:39:34 UTC 2022
#56496: Twenty Twenty-Two: Update comment block markup
-------------------------------------+----------------------------
Reporter: mikachan | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.1.1
Component: Bundled Theme | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-refresh | Focuses: accessibility
-------------------------------------+----------------------------
Changes (by ryokuhi):
* keywords: has-patch => has-patch needs-refresh
* focuses: => accessibility
* milestone: Future Release => 6.1.1
Comment:
From #56798:
> From [https://github.com/WordPress/wordpress-develop/pull/3136
wordpress-develop pull request 3136]:
> > The Post Comments block uses an h3 heading on it, this causes a11y
issues, ''as discussed in
[https://github.com/WordPress/gutenberg/issues/43203 Gutenberg issue
43203] (and previously in #55172)'', on the templates where it's inserted,
since there are no existing h2 in them. The new Comments block doesn't
have the same problem because it allows you to change the heading as you
need, but it's only available with Gutenberg or WP >= 6.1. To solve this
issue, we are doing the following:
> > * We are creating a hidden block pattern that inserts either of the
blocks depending on if the new block is registered and the WP version is
>= 6.1
> > * For users that will get the deprecated version of the block, we are
using the `render_block` hook to swap the h3 with an h2, and solve the
a11y for them
> > * Users that will get the newer version of the block, will have the h2
instead.
> > To test this:
> > * Run this branch, check a page with comments on it, you should be
seeing the headings using h2. On the editor, you should be seeing the new
Comments block (there is no deprecation message present). You may need to
tweak this line in `hidden-comments.php`, since this branch is still not a
6.1 version of WP:
> > {{{
> > if (
> > WP_Block_Type_Registry::get_instance()->is_registered(
'core/comments' ) &&
> > version_compare( $GLOBALS['wp_version'], '6.1', '>=' )
> > ) {
> > }}}
> > * Run the code from this branch on a 6.0 environment, you should be
seeing the old block, with the deprecation notice in the editor. In the
frontend, you should still see the headings on the comments block using
h2, instead of h3.
> > Aside from a11y, note that this PR also improves User Experience of
the TT2 theme: Users with WP >= 6.1 will get the Comments block in
editable mode automatically, rather than seeing the legacy mode and the
upgrade notice.
> This was raised in #55172, but deemed not a blocker to adding the
Accessibility Ready tag. Props to @poena when merged for raising this
issue.
After discussing ticket #56798 during the accessibility team's weekly bug
scrub, as suggested by @poena, we decided to close that ticket in favor of
this one. Props to @desrosj for reporting this discussion from the
wordpress-develop Pull Request to Trac.
We also decided to move this ticket to the 6.1.1 milestone, to add the
accessibility focus (as this is actually an accessibility issue), and to
ask for a patch refresh that takes into consideration the above.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56496#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list