diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index ff95f96745..55b2227c60 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -529,10 +529,17 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) { $comment_post_link = "$comment_post_title"; $comment_link = '#'; - $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'] = "" . _x('Trash', 'verb') . ''; - $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 ) { diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index bfec00987c..f8b95441a3 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -2158,9 +2158,18 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, '', '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'] = "" . __( 'Unapprove' ) . ''; @@ -2192,7 +2201,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, $actions['reply'] = '' . __('Reply') . ''; } - $actions = apply_filters( 'comment_row_actions', $actions, $comment ); + $actions = apply_filters( 'comment_row_actions', array_filter($actions), $comment ); $i = 0; echo '
';