bbp_validate_reply_to( int $reply_to, int $reply_id )

Validate a reply_to field for hierarchical replies


Description Description

Checks for 2 scenarios: — The reply to ID is actually a reply — The reply to ID does not match the current reply

See also See also


Top ↑

Parameters Parameters

$reply_to

(Required)

$reply_id

(Required)


Top ↑

Return Return

(int) $reply_to


Top ↑

Source Source

File: includes/replies/functions.php

function bbp_validate_reply_to( $reply_to = 0, $reply_id = 0 ) {

	// The parent reply must actually be a reply
	if ( ! bbp_is_reply( $reply_to ) ) {
		$reply_to = 0;
	}

	// The parent reply cannot be itself
	if ( $reply_id === $reply_to ) {
		$reply_to = 0;
	}

	return (int) $reply_to;
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.5.4 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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