Skip to:
Content

bbPress.org


Ignore:
Timestamp:
03/27/2018 07:38:26 PM (6 years ago)
Author:
johnjamesjacoby
Message:

Admin: improve topic/reply row-action UX.

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

  • Make approve & not-spam links green to match comments UI
  • More specifically target admin area links to avoid conflicts with other post types
  • Make "Approve" a blanket "publish" action, meaning it will always publish a topic/reply even from spam or trash
  • Make sure "Not Spam" will restore to "pending" if it was previously not published
  • Bump CSS version

See #1799.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/admin/replies.php

    r6780 r6790  
    471471                check_admin_referer( 'approve-reply_' . $reply_id );
    472472
    473                 $is_approve = bbp_is_reply_pending( $reply_id );
     473                $is_approve = bbp_is_reply_published( $reply_id );
    474474                $message    = ( true === $is_approve )
    475                     ? 'approved'
    476                     : 'unapproved';
     475                    ? 'unpproved'
     476                    : 'approved';
    477477                $success    = ( true === $is_approve )
    478478                    ? bbp_approve_reply( $reply_id )
     
    605605            'unapproved',
    606606            'spam',
     607            'unspam',
    607608            'trash',
    608609            'untrash',
     
    812813                $spam_uri  = wp_nonce_url( add_query_arg( array( 'reply_id' => $reply->ID, 'action' => 'bbp_toggle_reply_spam' ), remove_query_arg( array( 'bbp_reply_toggle_notice', 'reply_id', 'failed', 'super' ) ) ), 'spam-reply_'  . $reply->ID );
    813814                if ( bbp_is_reply_spam( $reply->ID ) ) {
    814                     $actions['spam'] = '<a href="' . esc_url( $spam_uri ) . '" title="' . esc_attr__( 'Mark the reply as not spam', 'bbpress' ) . '">' . esc_html__( 'Not spam', 'bbpress' ) . '</a>';
     815                    $actions['unspam'] = '<a href="' . esc_url( $spam_uri ) . '" title="' . esc_attr__( 'Mark the reply as not spam', 'bbpress' ) . '">' . esc_html__( 'Not Spam', 'bbpress' ) . '</a>';
    815816                } else {
    816817                    $actions['spam'] = '<a href="' . esc_url( $spam_uri ) . '" title="' . esc_attr__( 'Mark this reply as spam',    'bbpress' ) . '">' . esc_html__( 'Spam',     'bbpress' ) . '</a>';
Note: See TracChangeset for help on using the changeset viewer.