Skip to:
Content

bbPress.org


Ignore:
Timestamp:
03/27/2018 07:38:26 PM (7 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/topics.php

    r6780 r6790  
    589589                check_admin_referer( 'approve-topic_' . $topic_id );
    590590
    591                 $is_approve = bbp_is_topic_pending( $topic_id );
    592                 $message    = ( true === $is_approve )
    593                     ? 'approved'
    594                     : 'unapproved';
    595                 $success    = ( true === $is_approve )
     591                $is_approve = bbp_is_topic_published( $topic_id );
     592                $message    = ( false === $is_approve )
     593                    ? 'unapproved'
     594                    : 'approved';
     595                $success    = ( false === $is_approve )
    596596                    ? bbp_approve_topic( $topic_id )
    597597                    : bbp_unapprove_topic( $topic_id );
     
    788788            'closed',
    789789            'spam',
     790            'unspam',
    790791            'trash',
    791792            'untrash',
     
    10111012            $spam_uri = wp_nonce_url( add_query_arg( array( 'topic_id' => $topic->ID, 'action' => 'bbp_toggle_topic_spam' ), remove_query_arg( array( 'bbp_topic_toggle_notice', 'topic_id', 'failed', 'super' ) ) ), 'spam-topic_'  . $topic->ID );
    10121013            if ( bbp_is_topic_spam( $topic->ID ) ) {
    1013                 $actions['spam'] = '<a href="' . esc_url( $spam_uri ) . '" title="' . esc_attr__( 'Mark the topic as not spam', 'bbpress' ) . '">' . esc_html__( 'Not spam', 'bbpress' ) . '</a>';
     1014                $actions['unspam'] = '<a href="' . esc_url( $spam_uri ) . '" title="' . esc_attr__( 'Mark the topic as not spam', 'bbpress' ) . '">' . esc_html__( 'Not Spam', 'bbpress' ) . '</a>';
    10141015            } else {
    10151016                $actions['spam'] = '<a href="' . esc_url( $spam_uri ) . '" title="' . esc_attr__( 'Mark this topic as spam',    'bbpress' ) . '">' . esc_html__( 'Spam',     'bbpress' ) . '</a>';
Note: See TracChangeset for help on using the changeset viewer.