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/replies/functions.php

    r6784 r6791  
    16281628        bbp_get_spam_status_id()    => _x( 'Spam',    'Spam the reply',        'bbpress' ),
    16291629        bbp_get_trash_status_id()   => _x( 'Trash',   'Trash the reply',       'bbpress' ),
    1630         bbp_get_pending_status_id() => _x( 'Pending', 'Mark reply as pending', 'bbpress' ),
     1630        bbp_get_pending_status_id() => _x( 'Pending', 'Mark reply as pending', 'bbpress' )
    16311631    ), $reply_id );
    1632 }
    1633 
    1634 /**
    1635  * Return array of public reply statuses.
    1636  *
    1637  * @since 2.6.0 bbPress (r6705)
    1638  *
    1639  * @return array
    1640  */
    1641 function bbp_get_public_reply_statuses() {
    1642     $statuses = array(
    1643         bbp_get_public_status_id()
    1644     );
    1645 
    1646     // Filter & return
    1647     return (array) apply_filters( 'bbp_get_public_reply_statuses', $statuses );
    16481632}
    16491633
     
    17761760    }
    17771761
     1762    // Get new status
     1763    $status = bbp_get_public_status_id();
     1764
    17781765    // Bail if already approved
    1779     if ( bbp_get_pending_status_id() !== $reply->post_status ) {
     1766    if ( $status === $reply->post_status ) {
    17801767        return false;
    17811768    }
     
    17851772
    17861773    // Set publish status
    1787     $reply->post_status = bbp_get_public_status_id();
     1774    $reply->post_status = $status;
    17881775
    17891776    // No revisions
     
    18161803    }
    18171804
     1805    // Get new status
     1806    $status = bbp_get_pending_status_id();
     1807
    18181808    // Bail if already pending
    1819     if ( bbp_get_pending_status_id() === $reply->post_status ) {
     1809    if ( $status === $reply->post_status ) {
    18201810        return false;
    18211811    }
     
    18251815
    18261816    // Set pending status
    1827     $reply->post_status = bbp_get_pending_status_id();
     1817    $reply->post_status = $status;
    18281818
    18291819    // No revisions
Note: See TracChangeset for help on using the changeset viewer.