Make WordPress Core

Changeset 34006


Ignore:
Timestamp:
09/10/2015 05:48:34 PM (9 years ago)
Author:
wonderboymusic
Message:

Add a "View" row action for approved comments on the Dashboard screen, remove the link labeled #.

Props rachelbaker, zeo.
Fixes #18885.

File:
1 edited

Legend:

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

    r33932 r34006  
    566566    }
    567567
    568     $comment_link = '<a class="comment-link" href="' . esc_url(get_comment_link()) . '">#</a>';
    569 
    570568    $actions_string = '';
    571569    if ( current_user_can( 'edit_comment', $comment->comment_ID ) ) {
     
    576574            'edit' => '',
    577575            'spam' => '',
    578             'trash' => '', 'delete' => ''
     576            'trash' => '', 'delete' => '',
     577            'view' => '',
    579578        );
    580579
     
    593592        $actions['reply'] = '<a onclick="window.commentReply && commentReply.open(\''.$comment->comment_ID.'\',\''.$comment->comment_post_ID.'\');return false;" class="vim-r hide-if-no-js" title="'.esc_attr__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
    594593        $actions['spam'] = "<a href='$spam_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::spam=1' class='vim-s vim-destructive' title='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
    595         if ( !EMPTY_TRASH_DAYS )
     594
     595        if ( ! EMPTY_TRASH_DAYS ) {
    596596            $actions['delete'] = "<a href='$delete_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::trash=1' class='delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>';
    597         else
     597        } else {
    598598            $actions['trash'] = "<a href='$trash_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::trash=1' class='delete vim-d vim-destructive' title='" . esc_attr__( 'Move this comment to the trash' ) . "'>" . _x('Trash', 'verb') . '</a>';
     599        }
     600
     601        if ( '1' === $comment->comment_approved ) {
     602            $actions['view'] = '<a class="comment-link" href="' . esc_url( get_comment_link() ) . '">' . _x( 'View', 'verb' ) . '</a>';
     603        }
    599604
    600605        /**
     
    635640            <h4 class="comment-meta">
    636641                <?php printf( /* translators: 1: comment author, 2: post link, 3: notification if the comment is pending */__( 'From %1$s on %2$s%3$s' ),
    637                     '<cite class="comment-author">' . get_comment_author_link() . '</cite>', $comment_post_link.' '.$comment_link, ' <span class="approve">' . __( '[Pending]' ) . '</span>' ); ?>
     642                    '<cite class="comment-author">' . get_comment_author_link() . '</cite>', $comment_post_link, ' <span class="approve">' . __( '[Pending]' ) . '</span>' ); ?>
    638643            </h4>
    639644
     
    654659            <div class="dashboard-comment-wrap has-row-actions">
    655660            <?php /* translators: %1$s is type of comment, %2$s is link to the post */ ?>
    656             <h4 class="comment-meta"><?php printf( _x( '%1$s on %2$s', 'dashboard' ), "<strong>$type</strong>", $comment_post_link." ".$comment_link ); ?></h4>
     661            <h4 class="comment-meta"><?php printf( _x( '%1$s on %2$s', 'dashboard' ), "<strong>$type</strong>", $comment_post_link ); ?></h4>
    657662            <p class="comment-author"><?php comment_author_link(); ?></p>
    658663
Note: See TracChangeset for help on using the changeset viewer.