WordPress开发者和主题制作者的搜索引擎



get_cancel_comment_reply_link ›

Since2.7.0
已弃用n/a
get_cancel_comment_reply_link ( $text = '' )
参数:
  • (string) $text Optional. Text to display for cancel reply link. Default empty.
    Required: No
    默认: (empty)
返回:
  • (string)
定义在:
文档:

Retrieve HTML content for cancel comment reply link.



源码

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 );
}