From 4f00af88f15f44f99db71a14e12ea750916fd0cd Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 6 Mar 2008 21:48:20 +0000 Subject: [PATCH] Add unapprove links. Props mdawaffe. see #6094 git-svn-id: https://develop.svn.wordpress.org/trunk@7175 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/template.php | 36 ++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index d4ea5ffbdb..2c78380ea9 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -612,9 +612,10 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true else $ptime = mysql2date(__('Y/m/d \a\t g:i A'), $post->post_date); - $delete_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) ); - $approve_url = clean_url( wp_nonce_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "approve-comment_$comment->comment_ID" ) ); - $spam_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) ); + $delete_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) ); + $approve_url = clean_url( wp_nonce_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "approve-comment_$comment->comment_ID" ) ); + $unapprove_url = clean_url( wp_nonce_url( "comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "unapprove-comment_$comment->comment_ID" ) ); + $spam_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) ); ?> @@ -636,15 +637,26 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true - comment_post_ID) ) { - if ( 'approved' != $the_comment_status ) { - if ( $comment_status ) // we're looking at list of only approved or only unapproved comments - echo "" . __( 'Approve' ) . ' | '; - else // we're looking at all comments - echo "" . __( 'Approve' ) . ' | '; - } - echo "" . __( 'Spam' ) . ' | '; - echo "" . __('Delete') . ''; +comment_post_ID) ) { + $actions['approve'] = "" . __( 'Approve' ) . ' | '; + $actions['unapprove'] = "" . __( 'Unapprove' ) . ' | '; + $actions['spam'] = "" . __( 'Spam' ) . ' | '; + $actions['delete'] = "" . __('Delete') . ''; + + // we're looking at list of only approved or only unapproved comments + if ( 'moderated' == $comment_status ) { + $actions['approve'] = "" . __( 'Approve' ) . ' | '; + unset($actions['unapprove']); + } elseif ( 'approved' == $comment_status ) { + $actions['unapprove'] = "" . __( 'Unapprove' ) . ' | '; + unset($actions['approve']); + } + + foreach ( $actions as $action => $link ) + echo "$link"; } ?>