bbp_get_cancel_reply_to_link( string $text = '' )

Return the cancellation link for a reply to a reply

Description

Parameters

$text

(Optional) The cancel text

Default value: ''

Return

(string) The cancellation link

Source

File: bp-forums/replies/template.php

	function bbp_get_cancel_reply_to_link( $text = '' ) {

		// Bail if not hierarchical or editing a reply
		if ( ! bbp_thread_replies() || bbp_is_reply_edit() ) {
			return;
		}

		// Set default text
		if ( empty( $text ) ) {
			$text = __( 'Cancel', 'buddyboss' );
		}

		$reply_to = isset( $_GET['bbp_reply_to'] ) ? (int) $_GET['bbp_reply_to'] : 0;

		// Set visibility
		$style  = !empty( $reply_to ) ? '' : ' style="display:none;"';
		$link   = remove_query_arg( array( 'bbp_reply_to', '_wpnonce' ) ) . '#post-' . $reply_to;
		$retval = '<a rel="nofollow" id="bbp-cancel-reply-to-link" href="' . esc_url( $link ) . '"' . $style . '>' . esc_html( $text ) . '</a>';

		return apply_filters( 'bbp_get_cancel_reply_to_link', $retval, $link, $text );
	}

Changelog

Changelog
Version Description
bbPress (r4944) Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.