Opened 12 years ago
Closed 9 years ago
#23797 closed enhancement (fixed)
Hard coded HTML marking in comment_form()
Reported by: | Marie-Aude | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 3.5.1 |
Component: | Comments | Keywords: | has-patch |
Focuses: | Cc: |
Description
Hello
it seems so ugly hard coding has slipped in the comment form.
On line 1554 of comment-template.php, there is some hard-coded html :
<h3 id="reply-title"> <?php comment_form_title( $args['title_reply'], $args['title_reply_to'] ); ?> <small><?php cancel_comment_reply_link( $args['cancel_reply_link'] ); ?></small> </h3>
Semantically speaking, a H3 is far from being optimal.
Also, filters exists for all other elements of the comment form.
The h3 and small should not be hardcoded.
A new value could be included in the defaults :
'comment_reply_markup' => '<h3 id="reply-title">%1$s <small>%2$s</small></h3>',
and line 1554 replaced by :
<?php printf( $args['comment_reply_markup'], comment_form_title( $args['title_reply'], $args['title_reply_to'] ), cancel_comment_reply_link( $args['cancel_reply_link'] ); ?>
Thanks a lot, hope you'll take it :)
Attachments (6)
Change History (19)
#4
@
9 years ago
- Milestone changed from Awaiting Review to Future Release
Can we also keep the comment-reply-title
class added in 24525 to the h3 element? I don't see any reason for removing the id
attribute and changing the class
attribute. Before we remove the id
attribute from the h3 we should check and see how many themes are targeting it for styling.
I would also suggest changing comment_reply_markup
to be something more appropriate, perhaps comment_reply_title
?
I am +1 on the overall intent.
#6
@
9 years ago
- Keywords needs-refresh removed
23797.3.diff is a refresh with @rachelbaker's suggestions.
#7
@
9 years ago
- Milestone changed from Future Release to 4.4
- Owner set to johnbillion
- Status changed from new to reviewing
#9
@
9 years ago
- Keywords close added
This seems to have been fixed in [34308] in a slightly different way but this ticket is no longer needed I believe.
#10
@
9 years ago
The small
tag is still hard-coded after the changes in #33775. I recommend keeping this ticket open to remove all the hard-coded markup.
#11
@
9 years ago
- Keywords needs-docs close removed
23797.5.diff adds cancel_reply_(before|after) that can be altered the same was as title_reply_before.
If this is going to be addressed, then including a
class="reply-title"
attribute would mean that themes can use one less ID selector in their style.css.