Make WordPress Core

Changeset 37302 for trunk


Ignore:
Timestamp:
04/22/2016 09:29:19 PM (10 years ago)
Author:
wonderboymusic
Message:

Dashboard: toggle the "View" link for comments when Approving / Unapproving from the Dashboard widget.

Fixes #35518.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/dashboard.php

    r36964 r37302  
    631631                }
    632632
    633                 if ( '1' === $comment->comment_approved ) {
    634                         $actions['view'] = '<a class="comment-link" href="' . esc_url( get_comment_link( $comment ) ) . '" aria-label="' . esc_attr__( 'View this comment' ) . '">' . __( 'View' ) . '</a>';
    635                 }
     633                $actions['view'] = '<a class="comment-link" href="' . esc_url( get_comment_link( $comment ) ) . '" aria-label="' . esc_attr__( 'View this comment' ) . '">' . __( 'View' ) . '</a>';
    636634
    637635                /**
     
    654652
    655653                        // Reply and quickedit need a hide-if-no-js span
    656                         if ( 'reply' == $action || 'quickedit' == $action )
     654                        if ( 'reply' == $action || 'quickedit' == $action ) {
    657655                                $action .= ' hide-if-no-js';
    658 
     656                        }
     657
     658                        if ( 'view' === $action && '1' !== $comment->comment_approved ) {
     659                                $action .= ' hidden';
     660                        }
    659661                        $actions_string .= "<span class='$action'>$sep$link</span>";
    660662                }
  • trunk/src/wp-admin/js/edit-comments.js

    r36774 r37302  
    221221                                replyButton.text(adminCommentsL10n.replyApprove);
    222222
    223                         c.find('div.comment_status').html('0');
     223                        c.find( '.row-actions span.view' ).addClass( 'hidden' ).end()
     224                                .find( 'div.comment_status' ).html( '0' );
     225
    224226                } else {
    225227                        if ( settings.data.id == replyID )
    226228                                replyButton.text(adminCommentsL10n.reply);
    227229
    228                         c.find('div.comment_status').html('1');
     230                        c.find( '.row-actions span.view' ).removeClass( 'hidden' ).end()
     231                                .find( 'div.comment_status' ).html( '1' );
    229232                }
    230233
Note: See TracChangeset for help on using the changeset viewer.