/**
  * @covers ::bbp_forum_last_active_time
  * @covers ::bbp_get_forum_last_active_time
  */
 public function test_bbp_get_forum_last_active_time()
 {
     $c = $this->factory->forum->create(array('forum_meta' => array('forum_type' => 'category', 'status' => 'open')));
     $f = $this->factory->forum->create(array('post_parent' => $c, 'forum_meta' => array('forum_id' => $c, 'forum_type' => 'forum', 'status' => 'open')));
     $now = time();
     $post_date = date('Y-m-d H:i:s', $now - 60 * 60 * 100);
     // Get the forums last active time.
     $last_time = bbp_get_forum_last_active_time($f);
     $this->assertSame('', $last_time);
     // Get the categories last active time.
     $last_time = bbp_get_forum_last_active_time($c);
     $this->assertSame('', $last_time);
     $t = $this->factory->topic->create(array('post_parent' => $f, 'post_date' => $post_date, 'topic_meta' => array('forum_id' => $f)));
     bbp_update_forum_last_active_time($f);
     // Get the forums last active time.
     $last_time = bbp_get_forum_last_active_time($f);
     $this->assertSame('4 days, 4 hours ago', $last_time);
     // Get the categories last active time.
     $last_time = bbp_get_forum_last_active_time($c);
     $this->assertSame('4 days, 4 hours ago', $last_time);
     $this->factory->reply->create(array('post_parent' => $t, 'post_date' => $post_date, 'reply_meta' => array('forum_id' => $f, 'topic_id' => $t)));
     bbp_update_forum_last_active_time($f);
     // Get the forums last active time.
     $last_time = bbp_get_forum_last_active_time($f);
     $this->assertSame('4 days, 4 hours ago', $last_time);
     // Get the categories last active time.
     $last_time = bbp_get_forum_last_active_time($c);
     $this->assertSame('4 days, 4 hours ago', $last_time);
 }
/**
 * Walk up the ancestor tree from the current reply, and update all the counts
 *
 * @since bbPress (r2884)
 *
 * @param int $reply_id Optional. Reply id
 * @param string $last_active_time Optional. Last active time
 * @param int $forum_id Optional. Forum id
 * @param int $topic_id Optional. Topic id
 * @param bool $refresh If set to true, unsets all the previous parameters.
 *                       Defaults to true
 * @uses bbp_get_reply_id() To get the reply id
 * @uses bbp_get_reply_topic_id() To get the reply topic id
 * @uses bbp_get_reply_forum_id() To get the reply forum id
 * @uses get_post_ancestors() To get the ancestors of the reply
 * @uses bbp_is_reply() To check if the ancestor is a reply
 * @uses bbp_is_topic() To check if the ancestor is a topic
 * @uses bbp_update_topic_last_reply_id() To update the topic last reply id
 * @uses bbp_update_topic_last_active_id() To update the topic last active id
 * @uses bbp_get_topic_last_active_id() To get the topic last active id
 * @uses get_post_field() To get the post date of the last active id
 * @uses bbp_update_topic_last_active_time() To update the last active topic meta
 * @uses bbp_update_topic_voice_count() To update the topic voice count
 * @uses bbp_update_topic_reply_count() To update the topic reply count
 * @uses bbp_update_topic_reply_count_hidden() To update the topic hidden reply
 *                                              count
 * @uses bbp_is_forum() To check if the ancestor is a forum
 * @uses bbp_update_forum_last_topic_id() To update the last topic id forum meta
 * @uses bbp_update_forum_last_reply_id() To update the last reply id forum meta
 * @uses bbp_update_forum_last_active_id() To update the forum last active id
 * @uses bbp_get_forum_last_active_id() To get the forum last active id
 * @uses bbp_update_forum_last_active_time() To update the forum last active time
 * @uses bbp_update_forum_reply_count() To update the forum reply count
 */
function bbp_update_reply_walker($reply_id, $last_active_time = '', $forum_id = 0, $topic_id = 0, $refresh = true)
{
    // Verify the reply ID
    $reply_id = bbp_get_reply_id($reply_id);
    // Reply was passed
    if (!empty($reply_id)) {
        // Get the topic ID if none was passed
        if (empty($topic_id)) {
            $topic_id = bbp_get_reply_topic_id($reply_id);
        }
        // Get the forum ID if none was passed
        if (empty($forum_id)) {
            $forum_id = bbp_get_reply_forum_id($reply_id);
        }
    }
    // Set the active_id based on topic_id/reply_id
    $active_id = empty($reply_id) ? $topic_id : $reply_id;
    // Setup ancestors array to walk up
    $ancestors = array_values(array_unique(array_merge(array($topic_id, $forum_id), (array) get_post_ancestors($topic_id))));
    // If we want a full refresh, unset any of the possibly passed variables
    if (true === $refresh) {
        $forum_id = $topic_id = $reply_id = $active_id = $last_active_time = 0;
    }
    // Walk up ancestors
    if (!empty($ancestors)) {
        foreach ($ancestors as $ancestor) {
            // Reply meta relating to most recent reply
            if (bbp_is_reply($ancestor)) {
                // @todo - hierarchical replies
                // Topic meta relating to most recent reply
            } elseif (bbp_is_topic($ancestor)) {
                // Last reply and active ID's
                bbp_update_topic_last_reply_id($ancestor, $reply_id);
                bbp_update_topic_last_active_id($ancestor, $active_id);
                // Get the last active time if none was passed
                $topic_last_active_time = $last_active_time;
                if (empty($last_active_time)) {
                    $topic_last_active_time = get_post_field('post_date', bbp_get_topic_last_active_id($ancestor));
                }
                // Only update if reply is published
                if (bbp_is_reply_published($reply_id)) {
                    bbp_update_topic_last_active_time($ancestor, $topic_last_active_time);
                }
                // Counts
                bbp_update_topic_voice_count($ancestor);
                bbp_update_topic_reply_count($ancestor);
                bbp_update_topic_reply_count_hidden($ancestor);
                // Forum meta relating to most recent topic
            } elseif (bbp_is_forum($ancestor)) {
                // Last topic and reply ID's
                bbp_update_forum_last_topic_id($ancestor, $topic_id);
                bbp_update_forum_last_reply_id($ancestor, $reply_id);
                // Last Active
                bbp_update_forum_last_active_id($ancestor, $active_id);
                // Get the last active time if none was passed
                $forum_last_active_time = $last_active_time;
                if (empty($last_active_time)) {
                    $forum_last_active_time = get_post_field('post_date', bbp_get_forum_last_active_id($ancestor));
                }
                // Only update if reply is published
                if (bbp_is_reply_published($reply_id)) {
                    bbp_update_forum_last_active_time($ancestor, $forum_last_active_time);
                }
                // Counts
                bbp_update_forum_reply_count($ancestor);
            }
        }
    }
}
Example #3
0
/**
 * Updates the counts of a forum.
 *
 * This calls a few internal functions that all run manual queries against the
 * database to get their results. As such, this function can be costly to run
 * but is necessary to keep everything accurate.
 *
 * @since bbPress (r2908)
 *
 * @param mixed $args Supports these arguments:
 *  - forum_id: Forum id
 *  - last_topic_id: Last topic id
 *  - last_reply_id: Last reply id
 *  - last_active_id: Last active post id
 *  - last_active_time: last active time
 * @uses bbp_update_forum_last_topic_id() To update the forum last topic id
 * @uses bbp_update_forum_last_reply_id() To update the forum last reply id
 * @uses bbp_update_forum_last_active_id() To update the last active post id
 * @uses get_post_field() To get the post date of the last active id
 * @uses bbp_update_forum_last_active_time()  To update the last active time
 * @uses bbp_update_forum_subforum_count() To update the subforum count
 * @uses bbp_update_forum_topic_count() To update the forum topic count
 * @uses bbp_update_forum_reply_count() To update the forum reply count
 * @uses bbp_update_forum_topic_count_hidden() To update the hidden topic count
 */
function bbp_update_forum($args = '')
{
    // Parse arguments against default values
    $r = bbp_parse_args($args, array('forum_id' => 0, 'post_parent' => 0, 'last_topic_id' => 0, 'last_reply_id' => 0, 'last_active_id' => 0, 'last_active_time' => 0, 'last_active_status' => bbp_get_public_status_id()), 'update_forum');
    // Last topic and reply ID's
    bbp_update_forum_last_topic_id($r['forum_id'], $r['last_topic_id']);
    bbp_update_forum_last_reply_id($r['forum_id'], $r['last_reply_id']);
    // Active dance
    $r['last_active_id'] = bbp_update_forum_last_active_id($r['forum_id'], $r['last_active_id']);
    // If no active time was passed, get it from the last_active_id
    if (empty($r['last_active_time'])) {
        $r['last_active_time'] = get_post_field('post_date', $r['last_active_id']);
    }
    if (bbp_get_public_status_id() === $r['last_active_status']) {
        bbp_update_forum_last_active_time($r['forum_id'], $r['last_active_time']);
    }
    // Counts
    bbp_update_forum_subforum_count($r['forum_id']);
    bbp_update_forum_reply_count($r['forum_id']);
    bbp_update_forum_topic_count($r['forum_id']);
    bbp_update_forum_topic_count_hidden($r['forum_id']);
    // Update the parent forum if one was passed
    if (!empty($r['post_parent']) && is_numeric($r['post_parent'])) {
        bbp_update_forum(array('forum_id' => $r['post_parent'], 'post_parent' => get_post_field('post_parent', $r['post_parent'])));
    }
}
Example #4
0
/**
 * Updates the counts of a forum.
 *
 * This calls a few internal functions that all run manual queries against the
 * database to get their results. As such, this function can be costly to run
 * but is necessary to keep everything accurate.
 *
 * @since bbPress (r2908)
 *
 * @param mixed $args Supports these arguments:
 *  - forum_id: Forum id
 *  - last_topic_id: Last topic id
 *  - last_reply_id: Last reply id
 *  - last_active_id: Last active post id
 *  - last_active_time: last active time
 * @uses bbp_update_forum_last_topic_id() To update the forum last topic id
 * @uses bbp_update_forum_last_reply_id() To update the forum last reply id
 * @uses bbp_update_forum_last_active_id() To update the last active post id
 * @uses get_post_field() To get the post date of the last active id
 * @uses bbp_update_forum_last_active_time()  To update the last active time
 * @uses bbp_update_forum_subforum_count() To update the subforum count
 * @uses bbp_update_forum_topic_count() To update the forum topic count
 * @uses bbp_update_forum_reply_count() To update the forum reply count
 * @uses bbp_update_forum_topic_count_hidden() To update the hidden topic count
 */
function bbp_update_forum($args = '')
{
    $defaults = array('forum_id' => 0, 'post_parent' => 0, 'last_topic_id' => 0, 'last_reply_id' => 0, 'last_active_id' => 0, 'last_active_time' => 0, 'last_active_status' => bbp_get_public_status_id());
    $r = bbp_parse_args($args, $defaults, 'update_forum');
    extract($r);
    // Last topic and reply ID's
    bbp_update_forum_last_topic_id($forum_id, $last_topic_id);
    bbp_update_forum_last_reply_id($forum_id, $last_reply_id);
    // Active dance
    $last_active_id = bbp_update_forum_last_active_id($forum_id, $last_active_id);
    // If no active time was passed, get it from the last_active_id
    if (empty($last_active_time)) {
        $last_active_time = get_post_field('post_date', $last_active_id);
    }
    if (bbp_get_public_status_id() == $last_active_status) {
        bbp_update_forum_last_active_time($forum_id, $last_active_time);
    }
    // Counts
    bbp_update_forum_subforum_count($forum_id);
    bbp_update_forum_reply_count($forum_id);
    bbp_update_forum_topic_count($forum_id);
    bbp_update_forum_topic_count_hidden($forum_id);
    // Update the parent forum if one was passed
    if (!empty($post_parent) && is_numeric($post_parent)) {
        bbp_update_forum(array('forum_id' => $post_parent, 'post_parent' => get_post_field('post_parent', $post_parent)));
    }
}
Example #5
0
 /**
  * @covers ::bbp_update_forum_last_active_time
  */
 public function test_bbp_update_forum_last_active_time()
 {
     $f1 = $this->factory->forum->create();
     $f2 = $this->factory->forum->create(array('post_parent' => $f1));
     $t1 = $this->factory->topic->create(array('post_parent' => $f1, 'topic_meta' => array('forum_id' => $f1)));
     $r1 = $this->factory->reply->create(array('post_parent' => $t1, 'reply_meta' => array('forum_id' => $f1, 'topic_id' => $t1)));
     $r1_time_raw = get_post_field('post_date', $r1);
     $r1_time_formatted = bbp_get_time_since(bbp_convert_date($r1_time_raw));
     $time = bbp_update_forum_last_active_time($f1, $r1_time_raw);
     $this->assertSame($r1_time_raw, $time);
     $time = bbp_get_forum_last_active_time($f1);
     $this->assertSame($r1_time_formatted, $time);
     $t2 = $this->factory->topic->create(array('post_parent' => $f2, 'topic_meta' => array('forum_id' => $f2)));
     $r2 = $this->factory->reply->create(array('post_parent' => $t2, 'reply_meta' => array('forum_id' => $f2, 'topic_id' => $t2)));
     $r2_time_raw = get_post_field('post_date', $r2);
     $r2_time_formatted = bbp_get_time_since(bbp_convert_date($r2_time_raw));
     bbp_update_forum_last_active_time($f2);
     $time = bbp_get_forum_last_active_time($f2);
     $this->assertSame($r2_time_formatted, $time);
     bbp_update_forum_last_active_time($f1);
     $time = bbp_get_forum_last_active_time($f1);
     $this->assertSame($r2_time_formatted, $time);
 }
Example #6
0
/**
 * Updates the counts of a forum.
 *
 * This calls a few internal functions that all run manual queries against the
 * database to get their results. As such, this function can be costly to run
 * but is necessary to keep everything accurate.
 *
 * @since 2.0.0 bbPress (r2908)
 *
 * @param array $args Supports these arguments:
 *  - forum_id: Forum id
 *  - last_topic_id: Last topic id
 *  - last_reply_id: Last reply id
 *  - last_active_id: Last active post id
 *  - last_active_time: last active time
 * @uses bbp_update_forum_last_topic_id() To update the forum last topic id
 * @uses bbp_update_forum_last_reply_id() To update the forum last reply id
 * @uses bbp_update_forum_last_active_id() To update the last active post id
 * @uses get_post_field() To get the post date of the last active id
 * @uses bbp_update_forum_last_active_time()  To update the last active time
 * @uses bbp_update_forum_subforum_count() To update the subforum count
 * @uses bbp_update_forum_topic_count() To update the forum topic count
 * @uses bbp_update_forum_reply_count() To update the forum reply count
 * @uses bbp_update_forum_topic_count_hidden() To update the hidden topic count
 */
function bbp_update_forum($args = array())
{
    // Parse arguments against default values
    $r = bbp_parse_args($args, array('forum_id' => 0, 'post_parent' => 0, 'last_topic_id' => 0, 'last_reply_id' => 0, 'last_active_id' => 0, 'last_active_time' => 0, 'last_active_status' => bbp_get_public_status_id()), 'update_forum');
    // Last topic and reply ID's
    bbp_update_forum_last_topic_id($r['forum_id'], $r['last_topic_id']);
    bbp_update_forum_last_reply_id($r['forum_id'], $r['last_reply_id']);
    // Active dance
    $r['last_active_id'] = bbp_update_forum_last_active_id($r['forum_id'], $r['last_active_id']);
    // If no active time was passed, get it from the last_active_id
    if (empty($r['last_active_time'])) {
        $r['last_active_time'] = get_post_field('post_date', $r['last_active_id']);
    }
    if (bbp_get_public_status_id() === $r['last_active_status']) {
        bbp_update_forum_last_active_time($r['forum_id'], $r['last_active_time']);
    }
    // Counts
    bbp_update_forum_subforum_count($r['forum_id']);
    // Only update topic count if we're deleting a topic, or in the dashboard.
    if (in_array(current_filter(), array('bbp_deleted_topic', 'save_post'), true)) {
        bbp_update_forum_reply_count($r['forum_id']);
        bbp_update_forum_topic_count($r['forum_id']);
        bbp_update_forum_topic_count_hidden($r['forum_id']);
    }
    // Update the parent forum if one was passed
    if (!empty($r['post_parent']) && is_numeric($r['post_parent'])) {
        bbp_update_forum(array('forum_id' => $r['post_parent'], 'post_parent' => get_post_field('post_parent', $r['post_parent'])));
    }
}
Example #7
0
/**
 * Walk up the ancestor tree from the current reply, and update all the counts
 *
 * @since 2.0.0 bbPress (r2884)
 *
 * @param int $reply_id Optional. Reply id
 * @param string $last_active_time Optional. Last active time
 * @param int $forum_id Optional. Forum id
 * @param int $topic_id Optional. Topic id
 * @param bool $refresh If set to true, unsets all the previous parameters.
 *                       Defaults to true
 * @uses bbp_get_reply_id() To get the reply id
 * @uses bbp_get_reply_topic_id() To get the reply topic id
 * @uses bbp_get_reply_forum_id() To get the reply forum id
 * @uses get_post_ancestors() To get the ancestors of the reply
 * @uses bbp_is_reply() To check if the ancestor is a reply
 * @uses bbp_is_topic() To check if the ancestor is a topic
 * @uses bbp_update_topic_last_reply_id() To update the topic last reply id
 * @uses bbp_update_topic_last_active_id() To update the topic last active id
 * @uses bbp_get_topic_last_active_id() To get the topic last active id
 * @uses get_post_field() To get the post date of the last active id
 * @uses bbp_update_topic_last_active_time() To update the last active topic meta
 * @uses bbp_update_topic_voice_count() To update the topic voice count
 * @uses bbp_update_topic_reply_count() To update the topic reply count
 * @uses bbp_update_topic_reply_count_hidden() To update the topic hidden reply
 *                                              count
 * @uses bbp_is_forum() To check if the ancestor is a forum
 * @uses bbp_update_forum_last_topic_id() To update the last topic id forum meta
 * @uses bbp_update_forum_last_reply_id() To update the last reply id forum meta
 * @uses bbp_update_forum_last_active_id() To update the forum last active id
 * @uses bbp_get_forum_last_active_id() To get the forum last active id
 * @uses bbp_update_forum_last_active_time() To update the forum last active time
 * @uses bbp_update_forum_reply_count() To update the forum reply count
 */
function bbp_update_reply_walker($reply_id, $last_active_time = '', $forum_id = 0, $topic_id = 0, $refresh = true)
{
    // Verify the reply ID
    $reply_id = bbp_get_reply_id($reply_id);
    // Reply was passed
    if (!empty($reply_id)) {
        // Get the topic ID if none was passed
        if (empty($topic_id)) {
            $topic_id = bbp_get_reply_topic_id($reply_id);
            // Make every effort to get topic id
            // https://bbpress.trac.wordpress.org/ticket/2529
            if (empty($topic_id) && current_filter() === 'bbp_deleted_reply') {
                $topic_id = get_post_field('post_parent', $reply_id);
            }
        }
        // Get the forum ID if none was passed
        if (empty($forum_id)) {
            $forum_id = bbp_get_reply_forum_id($reply_id);
        }
    }
    // Set the active_id based on topic_id/reply_id
    $active_id = empty($reply_id) ? $topic_id : $reply_id;
    // Setup ancestors array to walk up
    $ancestors = array_values(array_unique(array_merge(array($topic_id, $forum_id), (array) get_post_ancestors($topic_id))));
    // If we want a full refresh, unset any of the possibly passed variables
    if (true === $refresh) {
        $forum_id = $topic_id = $reply_id = $active_id = $last_active_time = 0;
    }
    // Walk up ancestors
    if (!empty($ancestors)) {
        foreach ($ancestors as $ancestor) {
            // Reply meta relating to most recent reply
            if (bbp_is_reply($ancestor)) {
                // @todo - hierarchical replies
                // Topic meta relating to most recent reply
            } elseif (bbp_is_topic($ancestor)) {
                // Last reply and active ID's
                bbp_update_topic_last_reply_id($ancestor, $reply_id);
                bbp_update_topic_last_active_id($ancestor, $active_id);
                // Get the last active time if none was passed
                $topic_last_active_time = $last_active_time;
                if (empty($last_active_time)) {
                    $topic_last_active_time = get_post_field('post_date', bbp_get_topic_last_active_id($ancestor));
                }
                // Update the topic last active time regardless of reply status.
                // See https://bbpress.trac.wordpress.org/ticket/2838
                bbp_update_topic_last_active_time($ancestor, $topic_last_active_time);
                // Counts
                bbp_update_topic_voice_count($ancestor);
                // Only update reply count if we're deleting a reply, or in the dashboard.
                if (in_array(current_filter(), array('bbp_deleted_reply', 'save_post'), true)) {
                    bbp_update_topic_reply_count($ancestor);
                    bbp_update_topic_reply_count_hidden($ancestor);
                }
                // Forum meta relating to most recent topic
            } elseif (bbp_is_forum($ancestor)) {
                // Last topic and reply ID's
                bbp_update_forum_last_topic_id($ancestor, $topic_id);
                bbp_update_forum_last_reply_id($ancestor, $reply_id);
                // Last Active
                bbp_update_forum_last_active_id($ancestor, $active_id);
                // Get the last active time if none was passed
                $forum_last_active_time = $last_active_time;
                if (empty($last_active_time)) {
                    $forum_last_active_time = get_post_field('post_date', bbp_get_forum_last_active_id($ancestor));
                }
                // Only update if reply is published
                if (bbp_is_reply_published($reply_id)) {
                    bbp_update_forum_last_active_time($ancestor, $forum_last_active_time);
                }
                // Counts
                // Only update reply count if we're deleting a reply, or in the dashboard.
                if (in_array(current_filter(), array('bbp_deleted_reply', 'save_post'), true)) {
                    bbp_update_forum_reply_count($ancestor);
                }
            }
        }
    }
}
 /**
  * Perform the export
  *
  * @access public
  * @since 1.0
  * @uses bbp_Export::csv_rows_out()
  * @return void
  */
 public function import()
 {
     if (!$this->can_import()) {
         wp_die(__('You do not have permission to import data.', 'bbp-export-import'), __('Error', 'bbp-export-import'));
     }
     $csv_array = $this->csv_to_array($_FILES['bbp_csv_file']['tmp_name'], ';');
     foreach ($csv_array as $key => $line) {
         $post_args = $line;
         $meta_args = array();
         // Setup author date
         if ($post_args['anonymous'] == '1') {
             $meta_args['anonymous_email'] = $line['post_author'];
         } else {
             $user = get_user_by('email', $post_args['post_author']);
             if (!$user) {
                 // The user doesn't exist, so create them
                 $user = wp_insert_user(array('user_email' => $post_args['post_author'], 'user_login' => $post_args['user_login']));
             }
             $post_args['post_author'] = $user->ID;
         }
         // Decode content
         $post_args['post_content'] = html_entity_decode($post_args['post_content']);
         $topic_type = bbp_get_topic_post_type();
         $reply_type = bbp_get_reply_post_type();
         // Remove the post args we don't want sent to wp_insert_post
         unset($post_args['anonymous']);
         unset($post_args['user_login']);
         switch ($line['post_type']) {
             case $topic_type:
                 // Set the forum parent for topics
                 $post_args['post_parent'] = $this->forum_id;
                 $meta_args['voice_count'] = $line['voices'];
                 $meta_args['reply_count'] = $post_args['reply_count'];
                 $topic_id = bbp_insert_topic($post_args, $meta_args);
                 // Subscribe the original poster to the topic
                 bbp_add_user_subscription($post_args['post_author'], $topic_id);
                 // Add the topic to the user's favorites
                 if (bbp_is_user_favorite($post_args['post_author'], $topic_id)) {
                     bbp_add_user_favorite($post_args['post_author'], $topic_id);
                 }
                 // Set topic as resolved if GetShopped Support Forum is active
                 if ($post_args['resolved'] == '1') {
                     add_post_meta($topic_id, '_bbps_topic_status', '2');
                 }
                 break;
             case $reply_type:
                 // Set the forum parent for replies. The topic ID is created above when the replie's topic is first created
                 $post_args['post_parent'] = $topic_id;
                 $reply_id = bbp_insert_reply($post_args, $meta_args);
                 // Subscribe reply author, if not already
                 if (!bbp_is_user_subscribed($post_args['post_author'], $topic_id)) {
                     bbp_add_user_subscription($post_args['post_author'], $topic_id);
                 }
                 // Mark as favorite
                 if (bbp_is_user_favorite($post_args['post_author'], $topic_id)) {
                     bbp_add_user_favorite($post_args['post_author'], $topic_id);
                 }
                 // Check if the next row is a topic, meaning we have reached the last reply and need to update the last active time
                 if ($csv_array[$key + 1]['post_type'] == bbp_get_topic_post_type()) {
                     bbp_update_forum_last_active_time($this->forum_id, $post_args['post_date']);
                 }
                 break;
         }
     }
     // Recount forum topic / reply counts
     bbp_admin_repair_forum_topic_count();
     bbp_admin_repair_forum_reply_count();
     wp_redirect(admin_url('post.php?post=' . $this->forum_id . '&action=edit'));
     exit;
 }