[wp-trac] [WordPress Trac] #31298: "comment-reply-login" class missing from get_post_reply_link()
WordPress Trac
noreply at wordpress.org
Wed Feb 11 15:45:36 UTC 2015
#31298: "comment-reply-login" class missing from get_post_reply_link()
-----------------------------------+-----------------------
Reporter: johnjamesjacoby | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 4.2
Component: Comments | Version:
Severity: normal | Resolution:
Keywords: has-patch 2nd-opinion | Focuses: template
-----------------------------------+-----------------------
Comment (by johnjamesjacoby):
For context, the obvious use-case for a link like this is custom styling
in a theme.
The less obvious one is the ability to filter `post_comments_link` and
target that class specifically to modify it separately from `comment-
reply-link`.
One example for Bootstrap to add `btn` classes would be:
{{{
function bs_comment_reply_link( $link = '' ) {
$link = str_replace( 'comment-reply-login', 'comment-reply-login
btn btn-sm btn-default', $link );
$link = str_replace( 'comment-reply-link', 'comment-reply-link
btn btn-sm btn-default', $link );
return $link;
}
add_filter( 'comment_reply_link', 'bs_comment_reply_link' );
}}}
Right now, the same code cannot be applied to `post_comments_link` as the
`comment-reply-login` class does not exist. My above patch brings both
functions inline with each other.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31298#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list