Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#29782 closed defect (bug) (invalid)

'Before' and 'After' in get_comment_reply_link not working

Reported by: stereoactivo's profile stereoactivo Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.0
Component: Comments Keywords:
Focuses: Cc:

Description

Hi, I was using get_comment_reply_link, but 'before' and 'after' parameters aren't working.

I'm using this:

comment_reply_link (array_merge ($args, array (
	'before '    => '<button class="responder">',
	'after'      => '</button>',
	'reply_text' => __ ('reply', mytheme),
))); 

The output generated by wordpress doesn't include the strings that I used. I think that is caused by this line:

/*comment-template.php, line 1341 */
return apply_filters( 'comment_reply_link', $before . $link . $after, $args, $comment, $post );.

$before and $after aren't defined, and the values received in $args are never used.

Change History (3)

#1 @OriginalEXE
10 years ago

Hello,

are you sure your copy of WordPress is not modified? This is how that filter looks for me (and it works properly):

return apply_filters( 'comment_reply_link', $args['before'] . $link . $args['after'], $args, $comment, $post );

This is in WordPress 4.0 which you referenced in 'Version'. Can you please confirm that is the version of WordPress you are using.

Thanks

#2 @stereoactivo
10 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Hello,

This is very strange, I'm sure that I have the latest version of wordpress (4.0), and I didn't modify it before. Maybe when I updated it this file wasn't updated, I'm not sure why this happened.

#3 @DrewAPicture
10 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.