Opened 2 months ago

Last modified 2 months ago

#23797 new enhancement

Hard coded HTML marking in comment_form()

Reported by: Marie-Aude Owned by:
Priority: normal Milestone: Awaiting Review
Component: Comments Version: 3.5.1
Severity: normal Keywords:
Cc: info@…

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 (1)

23797.diff (1.8 KB) - added by MikeHansenMe 2 months ago.
patch based on comments

Download all attachments as: .zip

Change History (3)

  • Cc info@… added

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.

patch based on comments

Note: See TracTickets for help on using tickets.