// Cannot edit destination topic
if ( !current_user_can( 'edit_topic', $destination_topic->ID ) )
bbp_add_error( 'bbp_merge_topic_destination_permission', __( '<strong>ERROR</strong>: You do not have the permissions to edit the destination topic.', 'bbpress' ) );
/** No Errors *************************************************************/
if ( !bbp_has_errors() ) {
// Update counts, etc...
do_action( 'bbp_merge_topic', $destination_topic->ID, $source_topic->ID );
/** Date Check ********************************************************/
// Check if the destination topic is older than the source topic
if ( strtotime( $source_topic->post_date ) < strtotime( $destination_topic->post_date ) ) {
// Set destination topic post_date to 1 second before source topic
$destination_post_date = date( 'Y-m-d H:i:s', strtotime( $source_topic->post_date ) - 1 );
$postarr = array(