Skip to:
Content

bbPress.org

Changeset 3209


Ignore:
Timestamp:
05/24/2011 09:39:29 AM (15 years ago)
Author:
johnjamesjacoby
Message:

Use bbp_update_forum() in bbp_recount_rewalk() admin recount function. See #1534.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-admin/bbp-functions.php

    r3196 r3209  
    859859
    860860    // Forums need to know what their last active item is as well. Now it gets a bit more complex to do in the database.
    861     $forums = $wpdb->get_col( "SELECT `ID` FROM `$wpdb->posts` WHERE `post_type` = 'forum';" );
     861    $forums = $wpdb->get_col( "SELECT `ID` FROM `$wpdb->posts` WHERE `post_type` = 'forum' and `post_status` != 'auto-draft';" );
    862862    if ( is_wp_error( $forums ) )
    863863        return array( 10, sprintf( $statement, $result ) );
    864864
    865     foreach ( $forums as $forum ) {
    866         bbp_update_forum_last_active_id( $forum );
    867         bbp_update_forum_last_active_time( $forum );
    868     }
    869 
     865    // Loop through each forum and update them
     866    foreach ( $forums as $forum_id )
     867        bbp_update_forum( array( 'forum_id' => $forum_id ) );
     868
     869    // Complete results
    870870    $result = __( 'Complete!', 'bbpress' );
    871871    return array( 0, sprintf( $statement, $result ) );
Note: See TracChangeset for help on using the changeset viewer.