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
Parameters Parameters
- $reply_to
-
(Required)
- $reply_id
-
(Required)
Return Return
(int) $reply_to
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;
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.5.4 | Introduced. |