#36364 closed enhancement (invalid)
Change the heading H3 to H2 of 'Leave a Reply’, comment_form() for the accessibility
Reported by: | kassy000 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Comments | Keywords: | |
Focuses: | accessibility | Cc: |
Description
When I receiving the accessibility review of the theme I created,
the theme reviewer required change the heading up from H3 to H2 of 'Leave a Reply’.
Here the comment of the theme reviewer.
5) Headings: Fail
Move 'Leave a Reply' heading up to H2 and it passes.
https://themes.trac.wordpress.org/ticket/28202#comment:38
It’s seem to there are a code that able to change from H3 to H2 in comment.php of the default theme,Twenty Sixteen.
But When activated other themes, It’s need to insert params to comment.php,comment_form() manually.
Example:
comment_form( array( 'title_reply_before' => '<h2 id="reply-title" class="comment-reply-title">', 'title_reply_after' => '</h2>', ) );
So,I make a suggestion change the code of ‘wp-include/comment-templates.php’
line 2095 to 2097 of ‘wp-include/comment-templates.php’
* @type string $title_reply_before HTML displayed before the comment form title. * Default: '<h3 id="reply-title" class="comment-reply-title">'. * @type string $title_reply_after HTML displayed after the comment form title. * Default: '</h3>'.
Fixed code
* @type string $title_reply_before HTML displayed before the comment form title. * Default: '<h2 id="reply-title" class="comment-reply-title">'. * @type string $title_reply_after HTML displayed after the comment form title. * Default: '</h2>'.
line 2174 to 2175
'title_reply_before' => '<h3 id="reply-title" class="comment-reply-title">', 'title_reply_after' => '</h3>',
Fixed code
'title_reply_before' => '<h2 id="reply-title" class="comment-reply-title">', 'title_reply_after' => '</h2>',
Attachments (2)
Change History (11)
#2
@
9 years ago
- Summary changed from Change headings H3 to H2 of 'Leave a Reply’, comment_form(). to Change headings H3 to H2 of 'Leave a Reply’, comment_form(). for the accessibility.
#3
@
9 years ago
- Summary changed from Change headings H3 to H2 of 'Leave a Reply’, comment_form(). for the accessibility. to Change the heading H3 to H2 of 'Leave a Reply’, comment_form(). for the accessibility.
#4
@
9 years ago
- Summary changed from Change the heading H3 to H2 of 'Leave a Reply’, comment_form(). for the accessibility. to Change the heading H3 to H2 of 'Leave a Reply’, comment_form() for the accessibility
Note: See
TracTickets for help on using
tickets.
This isn't really a simple solution. The H3 was only wrong because of the context it was in within your theme -- because the previous heading was an H1, H3 was a problem. However, if the prior heading was an H2, it would have been perfectly correct.
Either option here can cause problems; it just depends on which set of problems it will cause. Currently, it's likely to cause problems with themes that use an H1 for their primary post heading; with this change, it would work fine for those, but cause problems with themes using an H2 or lower for their post heading.
On that point, I'm fairly indifferent to whether this changes in core. However, I will observe that changing core HTML output has a lot of impact on how people's sites will render, and I'm not sure this change would be worth causing that impact.