Reorder comment actions, fixes #11258

git-svn-id: http://svn.automattic.com/wordpress/trunk@12287 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-11-27 12:57:35 +00:00
parent fe29434e05
commit 2a8e03ae14
2 changed files with 21 additions and 5 deletions

View File

@ -529,10 +529,17 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
$comment_post_link = "<a href='$comment_post_url'>$comment_post_title</a>";
$comment_link = '<a class="comment-link" href="' . esc_url(get_comment_link()) . '">#</a>';
$actions = array();
$actions_string = '';
if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
// preorder it: Approve | Reply | Edit | Trash | Spam
$actions = array(
'approve' => '', 'unapprove' => '',
'reply' => '',
'edit' => '',
'trash' => '', 'delete' => '',
'spam' => ''
);
$del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) );
$approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "approve-comment_$comment->comment_ID" ) );
@ -552,7 +559,7 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
else
$actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . __( 'Move this comment to the trash' ) . "'>" . _x('Trash', 'verb') . '</a>';
$actions = apply_filters( 'comment_row_actions', $actions, $comment );
$actions = apply_filters( 'comment_row_actions', array_filter($actions), $comment );
$i = 0;
foreach ( $actions as $action => $link ) {

View File

@ -2158,9 +2158,18 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true,
</div>
<?php
}
$actions = array();
if ( $user_can ) {
// preorder it: Approve | Reply | Quick Edit | Edit | Trash | Spam
$actions = array(
'approve' => '', 'unapprove' => '',
'reply' => '',
'quickedit' => '',
'edit' => '',
'trash' => '', 'untrash' => '', 'delete' => '',
'spam' => '', 'unspam' => ''
);
if ( $comment_status && 'all' != $comment_status ) { // not looking at all comments
if ( 'approved' == $the_comment_status )
$actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&amp;new=unapproved vim-u vim-destructive' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
@ -2192,7 +2201,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true,
$actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\');return false;" class="vim-r" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
}
$actions = apply_filters( 'comment_row_actions', $actions, $comment );
$actions = apply_filters( 'comment_row_actions', array_filter($actions), $comment );
$i = 0;
echo '<div class="row-actions">';