From 10cbdb01ba81724ff377ee0476e8d2f35898448a Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 11 Sep 2008 17:18:26 +0000 Subject: [PATCH] Reorder comment actions. see #7552 git-svn-id: http://svn.automattic.com/wordpress/trunk@8864 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/template.php | 36 ++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index a3b90e09d8..d04be17a42 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -1279,30 +1279,40 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true $actions = array(); if ( current_user_can('edit_post', $comment->comment_post_ID) ) { - $actions['approve'] = "" . __( 'Approve' ) . " | "; - $actions['unapprove'] = "" . __( 'Unapprove' ) . " | "; - $actions['edit'] = "". __('Edit') . ' | '; - if ( 'spam' != $the_comment_status ) - $actions['spam'] = "" . __( 'Spam' ) . ' | '; - $actions['delete'] = "" . __('Delete') . ''; - + $actions['approve'] = "" . __( 'Approve' ) . ''; + $actions['unapprove'] = "" . __( 'Unapprove' ) . ''; if ( $comment_status ) { // not looking at all comments if ( 'approved' == $the_comment_status ) { - $actions['unapprove'] = "" . __( 'Unapprove' ) . ' | '; + $actions['unapprove'] = "" . __( 'Unapprove' ) . ''; unset($actions['approve']); } else { - $actions['approve'] = "" . __( 'Approve' ) . ' | '; + $actions['approve'] = "" . __( 'Approve' ) . ''; unset($actions['unapprove']); } } - if ( 'spam' != $the_comment_status ) - $actions['reply'] = ' | ' . __('Reply') . ''; + $actions['spam'] = "" . __( 'Spam' ) . ''; + $actions['delete'] = "" . __('Delete') . ''; + $actions['edit'] = "". __('Edit') . ''; + if ( 'spam' != $the_comment_status ) + $actions['reply'] = '' . __('Reply') . ''; $actions = apply_filters( 'comment_row_actions', $actions, $comment ); - foreach ( $actions as $action => $link ) - echo "$link\n"; + $action_count = count($actions); + $i = 0; + foreach ( $actions as $action => $link ) { + ++$i; + ( $i == $action_count ) ? $sep = '' : $sep = ' | '; + // The action before reply shouldn't output a sep + if ( 'edit' == $action ) + $sep = ''; + // Reply needs a hide-if-no-js span + if ( 'reply' == $action ) + echo " | $link$sep"; + else + echo "$link$sep"; + } } ?>