Skip to:
Content

bbPress.org

Changeset 6770


Ignore:
Timestamp:
01/18/2018 06:06:16 PM (7 years ago)
Author:
johnjamesjacoby
Message:

Metaboxes: show non-public replies in topic-replies meta/list box.

This shows trashed/spam replies to capable users when editing a topic via WordPress admin, because if you're moderating a topic from here, chances are high you want to see everything - not just public replies.

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bbpress.php

    r6744 r6770  
    204204        /** Versions **********************************************************/
    205205
    206         $this->version    = '2.6-rc-6743';
     206        $this->version    = '2.6-rc-6769';
    207207        $this->db_version = '262';
    208208
  • trunk/src/includes/admin/assets/css/admin.css

    r6709 r6770  
    422422}
    423423
    424 #the-list .status-spam {
     424#the-list .status-spam,
     425#bbp-reply-list .status-trash {
    425426    background-color: #fee;
    426427}
    427428
    428 #the-list .status-spam:nth-child(odd) {
     429#the-list .status-spam:nth-child(odd),
     430#bbp-reply-list .status-trash:nth-child(odd) {
    429431    background-color: #fdd;
    430432}
     
    439441
    440442#the-list .status-closed td,
    441 #the-list .status-spam td {
     443#the-list .status-spam td,
     444#bbp-reply-list .status-trash td {
    442445    color: #999;
    443446}
  • trunk/src/includes/admin/classes/class-bbp-topic-replies-list-table.php

    r6769 r6770  
    200200        $orderby      = ! empty( $_REQUEST['orderby'] ) ? sanitize_key( $_REQUEST['orderby'] ) : 'date';
    201201        $order        = ! empty( $_REQUEST['order']   ) ? sanitize_key( $_REQUEST['order']   ) : 'asc';
     202        $statuses     = bbp_get_public_reply_statuses();
     203
     204        // Maybe add private statuses to query
     205        if ( current_user_can( 'edit_others_replies' ) ) {
     206
     207            // Default view=all statuses
     208            $statuses = array_keys( bbp_get_topic_statuses() );
     209
     210            // Add support for private status
     211            if ( current_user_can( 'read_private_replies' ) ) {
     212                $statuses[] = bbp_get_private_status_id();
     213            }
     214        }
    202215
    203216        // Query for replies
    204217        $reply_query  = new WP_Query( array(
    205218            'post_type'           => bbp_get_reply_post_type(),
     219            'post_status'         => $statuses,
    206220            'post_parent'         => $topic_id,
    207221            'posts_per_page'      => $per_page,
     
    210224            'order'               => ucwords( $order ),
    211225            'hierarchical'        => false,
    212             'ignore_sticky_posts' => true,
     226            'ignore_sticky_posts' => true
    213227        ) );
    214228
     
    249263        $this->display_tablenav( 'top' ); ?>
    250264
    251         <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
     265        <table id="bbp-reply-list" class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
    252266            <thead>
    253267                <tr>
  • trunk/src/includes/replies/template.php

    r6745 r6770  
    160160
    161161        // Default view=all statuses
    162         $post_statuses = array(
    163             bbp_get_public_status_id(),
    164             bbp_get_closed_status_id(),
    165             bbp_get_spam_status_id(),
    166             bbp_get_trash_status_id(),
    167             bbp_get_pending_status_id()
    168         );
     162        $post_statuses = array_keys( bbp_get_topic_statuses() );
    169163
    170164        // Add support for private status
Note: See TracChangeset for help on using the changeset viewer.