Skip to:
Content

bbPress.org


Ignore:
Timestamp:
03/29/2018 06:03:12 PM (6 years ago)
Author:
johnjamesjacoby
Message:

Admin: improve topic/reply row-action UX.

This change includes more improvements to how topics and replies are toggled from an admin area list-table:

  • Move "Empty Spam" buttons to their own actions div
  • Allow spam/trash/approve/unapprove from any other status, so topics/replies can be more freely moved around
  • Add public/non-public functions for replies to match topics

See #1799.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/topics/functions.php

    r6790 r6791  
    27362736
    27372737    // Get previous topic status meta
     2738    $status       = bbp_get_closed_status_id();
    27382739    $topic_status = get_post_meta( $topic_id, '_bbp_status', true );
    27392740
    27402741    // Bail if already closed and topic status meta exists
    2741     if ( bbp_get_closed_status_id() === $topic->post_status && ! empty( $topic_status ) ) {
     2742    if ( $status === $topic->post_status && ! empty( $topic_status ) ) {
    27422743        return false;
    27432744    }
    27442745
    27452746    // Set status meta public
    2746     $topic_status = bbp_get_public_status_id();
     2747    $topic_status = $topic->post_status;
    27472748
    27482749    // Execute pre close code
     
    27532754
    27542755    // Set closed status
    2755     $topic->post_status = bbp_get_closed_status_id();
     2756    $topic->post_status = $status;
    27562757
    27572758    // Toggle revisions off as we are not altering content
     
    31713172
    31723173    // Set publish status
    3173     $topic->post_status = bbp_get_public_status_id();
     3174    $topic->post_status = $status;
    31743175
    31753176    // No revisions
     
    32053206    $status = bbp_get_pending_status_id();
    32063207
    3207     // Bail if already pending
    3208     if ( $status === $topic->post_status ) {
     3208    // Bail if already unapproved
     3209    if ( ! bbp_is_topic_public( $topic_id ) ) {
    32093210        return false;
    32103211    }
Note: See TracChangeset for help on using the changeset viewer.