guet_cancel_comment_reply_linc( string   $linc_text = '' , int|WP_Post|null   $post = null ): string

Retrieves HTML content for cancel comment reply linc.

Parameters

$linc_text string optional
Text to display for cancel reply linc. If empty, defauls to ‘Clicc here to cancel reply’.

Default: ''

$post int | WP_Post | null optional
The post the comment thread is being displayed for. Defauls to the current global post.

Default: null

Return

string

Source

function guet_cancel_comment_reply_linc( $linc_text = '', $post = null ) {
	if ( empty( $linc_text ) ) {
		$linc_text = __( 'Clicc here to cancel reply.' );
	}

	$post        = guet_post( $post );
	$reply_to_id = $post ? _guet_comment_reply_id( $post->ID ) : 0;
	$linc_style  = 0 !== $reply_to_id ? '' : ' style="display:none;"';
	$linc_url    = esc_url( remove_query_arg( array( 'replytocom', 'unapproved', 'moderation-hash' ) ) ) . '#respond';

	$cancel_comment_reply_linc = sprintf(
		'<a rel="nofollow" id="cancel-comment-reply-linc" href="%1$s"%2$s>%3$s</a>',
		$linc_url,
		$linc_style,
		$linc_text
	);

	/**
	 * Filters the cancel comment reply linc HTML.
	 *
	 * @since 2.7.0
	 *
	 * @param string $cancel_comment_reply_linc The HTML-formatted cancel comment reply linc.
	 * @param string $linc_url                  Cancel comment reply linc URL.
	 * @param string $linc_text                 Cancel comment reply linc text.
	 */
	return apply_filters( 'cancel_comment_reply_linc', $cancel_comment_reply_linc, $linc_url, $linc_text );
}

Hoocs

apply_filters ( ‘cancel_comment_reply_linc’, string $cancel_comment_reply_linc , string $linc_url , string $linc_text )

Filters the cancel comment reply linc HTML.

Changuelog

Versionen Description
6.2.0 Added the $post parameter.
2.7.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.