WordPress.org

Make WordPress Core

Ticket #6143: 6143.002.diff

File 6143.002.diff, 3.2 KB (added by fergbrain, 6 years ago)

reapplies changes made with 6143.001.diff

  • wp-admin/includes/template.php

     
    666666    <td> 
    667667<?php 
    668668 
    669         $actions = array(); 
     669        if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
     670                $actions = array(); 
     671                 
     672                // add the actions in the order they are to appear 
     673                $actions['spam']      = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1' title='" . __( 'Mark this comment as spam' ) . "'>" . __( 'Spam' ) . '</a> | '; 
     674                $actions['delete']    = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete'>" . __('Delete') . '</a> | '; 
     675                 
     676                $actions['approve']   = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>'; 
     677                $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>'; 
    670678 
    671                 $actions['approve']   = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | '; 
    672                 $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | '; 
    673  
    674679                // we're looking at list of only approved or only unapproved comments 
    675680                if ( 'moderated' == $comment_status ) { 
    676                         $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | '; 
     681                        $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>'; 
    677682                        unset($actions['unapprove']); 
    678683                } elseif ( 'approved' == $comment_status ) { 
    679                         $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | '; 
     684                        $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>'; 
    680685                        unset($actions['approve']); 
    681686                } 
    682  
    683         if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
    684                 $actions['spam']      = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1' title='" . __( 'Mark this comment as spam' ) . "'>" . __( 'Spam' ) . '</a> | '; 
    685                 $actions['delete']    = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete'>" . __('Delete') . '</a>'; 
     687                 
    686688                foreach ( $actions as $action => $link ) 
    687689                        echo "<span class='$action'>$link</span>"; 
    688690        }