bbp_update_reply_to( int $reply_id, int $reply_to )

Update the reply’s meta data with its reply to id

Description

Parameters

$reply_id

(Required) Reply id to update

$reply_to

(Optional) Reply to id

Return

(bool) Reply's parent reply id

Source

File: bp-forums/replies/functions.php

1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
function bbp_update_reply_to( $reply_id = 0, $reply_to = 0 ) {
 
    // Validation
    $reply_id = bbp_get_reply_id( $reply_id );
    $reply_to = bbp_validate_reply_to( $reply_to );
 
    // Update or delete the `reply_to` postmeta
    if ( ! empty( $reply_id ) ) {
 
        // Update the reply to
        if ( !empty( $reply_to ) ) {
            update_post_meta( $reply_id, '_bbp_reply_to', $reply_to );
 
        // Delete the reply to
        } else {
            delete_post_meta( $reply_id, '_bbp_reply_to' );
        }
    }
 
    return (int) apply_filters( 'bbp_update_reply_to', (int) $reply_to, $reply_id );
}

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.