WordPress.org

Making WordPress.org

Changeset 9344


Ignore:
Timestamp:
12/13/2019 08:17:13 PM (2 months ago)
Author:
johnjamesjacoby
Message:

bbPress: general code updating & improvements to recount tool.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/buddypress.org/public_html/wp-content/themes/bb-base/functions.php

    r9343 r9344  
    523523    }
    524524
     525    // Bail if not capable
     526    if ( ! current_user_can( 'moderate' ) ) {
     527        return;
     528    }
     529
    525530    // Refresh topic data
    526531    if ( bbp_is_single_topic() ) {
    527 
    528         // Bail if not capable
    529         if ( ! current_user_can( 'moderate' ) ) {
    530             return;
    531         }
    532532
    533533        // Get the topic ID
     
    544544
    545545        // Redirect without _GET
    546         wp_safe_redirect( bbp_get_topic_permalink() );
    547         die;
     546        bbp_redirect( bbp_get_topic_permalink() );
    548547
    549548    // Refresh forum data
    550549    } elseif ( bbp_is_single_forum() ) {
    551550
    552         // Bail if not capable
    553         if ( ! current_user_can( 'moderate' ) ) {
    554             return;
    555         }
    556 
    557         bbp_update_forum_last_reply_id();
    558         bbp_update_forum_last_topic_id();
    559         bbp_update_forum_last_active_id();
    560         bbp_update_forum_last_active_time();
     551        // Get the forum ID
     552        $forum_id = bbp_get_forum_id();
     553
     554        bbp_update_forum_last_reply_id( $forum_id );
     555        bbp_update_forum_last_topic_id( $forum_id );
     556        bbp_update_forum_last_active_id( $forum_id );
     557        bbp_update_forum_last_active_time( $forum_id );
    561558
    562559        bb_base_purge_support_topics();
     
    564561
    565562        // Redirect without _GET
    566         wp_safe_redirect( bbp_get_forum_permalink() );
    567         die;
     563        bbp_redirect( bbp_get_forum_permalink() );
    568564    }
    569565}
Note: See TracChangeset for help on using the changeset viewer.