Plugin Download: [download id="2" format="1"]
Version: Version 1.0
Requirements: PHP 5 & WordPress 2.7.x
Based on the comment_form_title function, this plugin allows you to add the name of the comment author to the Leave a Reply title. Replaces the comment_reply_link function.
Use this plugin at your own risk. It’s not going to blow up your website but it requires more knowledge than I can include here. Before using, you should read and understand this and this.
If you use this plugin, do not add the following to your template (from these instructions):
if ( is_singular() ) wp_enqueue_script( 'comment-reply' )
The Enhanced Javascript Comment Functionality plugin takes care of it for you.
You must add a comment_author id to some element, preferably in your comments.php theme file. For example, in my comments.php, I use:
You must be using the callback parameter in wp_list_comments, likely in your comments.php theme file. For example, in my comments.php, I use:
You must use this plugin’s ejcf_comment_reply_link function instead of the WordPress comment_reply_link or get_comment_reply_link. For example, in my style_the_comment function (located in my theme’s functions.php), I use:
$comment_reply_link = ejcf_comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'], 'reply_text' => __('Reply to Comment'), 'noreplytext' => __('Reply to Post'), 'replytext' => __('Reply to %s'), 'echo' => 0)));
This is the full function:
function style_the_comment($comment, $args, $depth) {
global $comment_count;
$comment_count++;
$GLOBALS['comment'] = $comment;
$comment_reply_link = ejcf_comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'], 'reply_text' => __('Reply to Comment'), 'noreplytext' => __('Reply to Post'), 'replytext' => __('Reply to %s'), 'echo' => 0)));
$output = '
The ejcf_comment_reply_link function replaces the comment_reply_link and get_comment_reply_link functions. As of the writing of this, the comment_reply_link codex page contains no details. So let me break it down for you:
In my style_the_comment function, the resultant string is:
Reply to Comment
'.$comment_reply_link.' ' : '').'