1436c1436,1443
<  * @param string $text Optional. Text to display for cancel reply link. Default empty.
---
>  * @param array $args {
>  *     Optional. Override default arguments.
>  *
>  *     @type string $text Optional. Text to display for cancel reply link. Default empty.
>  *     @type string $respond_id The selector identifying the responding comment. Passed as the third parameter
>  *                              to addComment.moveForm(), and appended to the link URL as a hash value.
>  *                              Default 'respond'.
>  * }
1438,1440c1445,1455
< function get_cancel_comment_reply_link( $text = '' ) {
< 	if ( empty($text) )
< 		$text = __('Click here to cancel reply.');
---
> function get_cancel_comment_reply_link( $args = array() ) {
> 	$defaults = array(
> 		'text'       => __('Click here to cancel reply.'),
> 		'respond_id' => 'respond'
> 	);
> 
> 	// Fallback for Wordpress < 3.9.1
> 	if( !is_array($args) )
> 		$args = array('text' => $args);
> 
> 	$args = wp_parse_args($args, $defaults);
1442,1443c1457,1461
< 	$style = isset($_GET['replytocom']) ? '' : ' style="display:none;"';
< 	$link = esc_html( remove_query_arg('replytocom') ) . '#respond';
---
> 	extract($args, EXTR_SKIP);
> 
> 	$comment = get_comment($_GET['replytocom']);
> 	$style = $comment && $comment->comment_post_ID == get_the_ID() ? '' : ' style="display:none;"';
> 	$link = esc_html( remove_query_arg('replytocom') ) . '#' . $respond_id;
1463c1481,1488
<  * @param string $text Optional. Text to display for cancel reply link. Default empty.
---
>  * @param array $args {
>  *     Optional. Override default arguments.
>  *
>  *     @type string $text Optional. Text to display for cancel reply link. Default empty.
>  *     @type string $respond_id The selector identifying the responding comment. Passed as the third parameter
>  *                              to addComment.moveForm(), and appended to the link URL as a hash value.
>  *                              Default 'respond'.
>  * }
1465,1466c1490,1491
< function cancel_comment_reply_link( $text = '' ) {
< 	echo get_cancel_comment_reply_link($text);
---
> function cancel_comment_reply_link( $args = array() ) {
> 	echo get_cancel_comment_reply_link($args);
