get_cancel_comment_reply_link

函数
get_cancel_comment_reply_link ( $text = '' )
参数
  • (string) $text Optional. Text to display for cancel reply link. If empty, defaults to 'Click here to cancel reply'. Default empty.
    Required:
    Default: (empty)
返回值
  • (string)
定义位置
相关方法
cancel_comment_reply_linkget_comment_reply_linkcomment_reply_linkget_next_comments_linkget_edit_comment_link
引入
2.7.0
弃用
-

get_cancel_comment_reply_link:此函数检索HTML链接以取消注释回复表单。它接受两个参数:$text和$type。$text参数是要在链接中显示的文本,$type参数是要用于链接的HTML元素类型。默认情况下,链接显示为元素。

检索取消评论回复链接的HTML内容。

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( array( 'replytocom', 'unapproved', 'moderation-hash' ) ) ) . '#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 );
}

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2026-01-29 12:09:40

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: