Skip to:
Content

bbPress.org

Changeset 2934


Ignore:
Timestamp:
02/24/2011 10:25:15 PM (15 years ago)
Author:
johnjamesjacoby
Message:

Clean up the default topic status code in bbp_has_topics()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-topic-template.php

    r2933 r2934  
    6464    global $wp_rewrite, $wp_query, $bbp, $wpdb;
    6565
     66    // Do we show hidden topics by default?
     67    if ( !empty( $_GET['view'] ) && 'all' == $_GET['view'] && current_user_can( 'edit_others_topics' ) )
     68        $default_status = join( ',', array( 'publish', $bbp->spam_status_id, 'trash' ) );
     69    else
     70        $default_status = 'publish';
     71
     72    // Default arguments
    6673    $default = array (
    6774        // Narrow query down to bbPress topics
     
    96103
    97104        // Post Status
    98         'post_status'    => ( !empty( $_GET['view'] ) && 'all' == $_GET['view'] && current_user_can( 'edit_others_topics' ) ) ? join( ',', array( 'publish', $bbp->spam_status_id, 'trash' ) ) : 'publish',
     105        'post_status'          => $default_status,
    99106    );
    100107
Note: See TracChangeset for help on using the changeset viewer.