Opened 9 years ago
Closed 9 years ago
#33775 closed defect (bug) (fixed)
comment_form() Leave a Reply heading level can't be changed
Reported by: | afercia | Owned by: | afercia |
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 4.3 |
Component: | Comments | Keywords: | has-patch commit |
Focuses: | accessibility | Cc: |
Description
When using comment_form()
to output the complete comment form, the "Leave a Reply" heading is assumed to be a <h3>
and there's no way to change the heading level. See the screenshot below, it's the heading structure in Twenty Sixteen.
- when there are comments: the headings hierarchy doesn't miss levels but I'd say the
<h3>
should be a<h2>
anyways - when there are no comments yet, there's a missing heading level
Assuming a <h3>
will be always a correct heading level it's just... well an assumption. IMHO, functions that output HTML should always give the ability to filter the output or set the relevant part of the HTML using arguments.
Attachments (1)
Change History (9)
This ticket was mentioned in Slack in #core-themes by afercia. View the logs.
9 years ago
#2
@
9 years ago
- Milestone changed from Awaiting Review to 4.4
- Owner set to afercia
- Status changed from new to assigned
@
9 years ago
In comment_form()
: implement title_reply_before
and title_reply_after
args to allow modifying the HTML of the comment form reply title.
#5
@
9 years ago
Ideally, to avoid the missing heading level, the default should be a <h2>
. I fear we can't change that for backwards compatibility but maybe we should consider to use what @tyxla suggested and make it a <h2>
in the bundled themes, starting with Twenty Sixteen. Also to inform and educate theme authors. Below, the current situation keeping the <h3>
as default:
A <h2>
would make sense in both cases and would allow to keep it simple (no conditionals). Thoughts? cc @iamtakashi @obenland
#6
follow-up:
↓ 7
@
9 years ago
Yeah, we can't change it to an <h2>
by default. We could possibly make it an h2/h3 based on whether the post has comments or not. Just a quick thought, not fully thought through.
#7
in reply to:
↑ 6
@
9 years ago
- Keywords commit added
Replying to obenland:
We could possibly make it an h2/h3 based on whether the post has comments or not. Just a quick thought, not fully thought through.
Yeah, was thinking to keep it simple and just change it (via arguments) in h2 without any check/conditional. Thoughts about the patch? I'd say commit consideration. :)
Cool idea.
I suggest that we implement that by adding 2 additional
comment_form()
args:title_reply_before
andtitle_reply_after
.This would allow the user to:
comment_form()
;comment_form_defaults
filter;Patch coming up.