检索取消评论回复链接的HTML内容。
原型
get_cancel_comment_reply_link( string $text = '' )
参数
$text
(string)
(Optional)
要显示取消回复链接的文本。
返回值
(string)
源文件
路径:wp-includes/comment-template.php
<?php
...
function get_cancel_comment_reply_link( $text = '' ) {
if ( empty($text) )
$text = __('Click here to cancel reply.');
$style = isset($_GET['replytocom']) ? '' : ' style="display:none;"';
$link = esc_html( remove_query_arg('replytocom') ) . '#respond';
$formatted_link = '<a rel="nofollow" id="cancel-comment-reply-link" href="' . $link . '"' . $style . '>' . $text . '</a>';
/**
* Filters the cancel comment reply link HTML.
*
* @since 2.7.0
*
* @param string $formatted_link The HTML-formatted cancel comment reply link.
* @param string $link Cancel comment reply link URL.
* @param string $text Cancel comment reply link text.
*/
return apply_filters( 'cancel_comment_reply_link', $formatted_link, $link, $text );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/get_cancel_comment_reply_link/