// Update the reply
wp_update_post( $postarr );
// Adjust reply meta values
bbp_update_reply_topic_id( $reply->ID, $destination_topic->ID );
bbp_update_reply_forum_id( $reply->ID, bbp_get_topic_forum_id( $destination_topic->ID ) );
// Do additional actions per split reply
do_action( 'bbp_split_topic_reply', $reply->ID, $destination_topic->ID );
}
}
// It is a new topic and we need to set some default metas to make
// the topic display in bbp_has_topics() list
if ( 'reply' == $split_option ) {
$last_reply_id = ( empty( $reply ) || empty( $reply->ID ) ) ? 0 : $reply->ID;
$freshness = ( empty( $reply ) || empty( $reply->post_date ) ) ? '' : $reply->post_date;
bbp_update_topic_last_reply_id ( $destination_topic->ID, $last_reply_id );