$parent_file = 'edit-comments.php';
$submenu_file = 'edit-comments.php';
+global $action;
wp_reset_vars( array('action') );
if ( isset( $_POST['deletecomment'] ) )
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
- '<p>' . __( '<a href="http://codex.wordpress.org/Administration_Screens#Comments" target="_blank">Documentation on Comments</a>' ) . '</p>' .
+ '<p>' . __( '<a href="https://codex.wordpress.org/Administration_Screens#Comments" target="_blank">Documentation on Comments</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
);
$nonce_action .= $comment_id;
?>
-<div class='wrap'>
-
-<div class="narrow">
+<div class="wrap">
<h2><?php echo esc_html( $title ); ?></h2>
switch ( $action ) {
case 'spam' :
$caution_msg = __('You are about to mark the following comment as spam:');
- $button = __('Spam Comment');
+ $button = __('Mark as Spam');
break;
case 'trash' :
$caution_msg = __('You are about to move the following comment to the Trash:');
- $button = __('Trash Comment');
+ $button = __('Move to Trash');
break;
case 'delete' :
$caution_msg = __('You are about to delete the following comment:');
$message = __('This comment is currently in the Trash.');
break;
}
- if ( $message )
- echo '<div class="updated"><p>' . $message . '</p></div>';
+ if ( $message ) {
+ echo '<div class="notice notice-info"><p>' . $message . '</p></div>';
+ }
}
?>
<p><strong><?php _e('Caution:'); ?></strong> <?php echo $caution_msg; ?></p>
<table class="form-table comment-ays">
-<tr class="alt">
+<tr>
<th scope="row"><?php _e('Author'); ?></th>
<td><?php echo $comment->comment_author; ?></td>
</tr>
<td><a href="<?php echo $comment->comment_author_url; ?>"><?php echo $comment->comment_author_url; ?></a></td>
</tr>
<?php } ?>
+<tr>
+ <th scope="row"><?php _e( 'In Response To' ); ?></th>
+ <td>
+ <?php
+ $post_id = $comment->comment_post_ID;
+ if ( current_user_can( 'edit_post', $post_id ) ) {
+ $post_link = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>";
+ $post_link .= esc_html( get_the_title( $post_id ) ) . '</a>';
+ } else {
+ $post_link = esc_html( get_the_title( $post_id ) );
+ }
+ echo $post_link;
+
+ if ( $comment->comment_parent ) {
+ $parent = get_comment( $comment->comment_parent );
+ $parent_link = esc_url( get_comment_link( $comment->comment_parent ) );
+ $name = get_comment_author( $parent->comment_ID );
+ printf( ' | ' . __( 'In reply to <a href="%1$s">%2$s</a>.' ), $parent_link, $name );
+ }
+ ?>
+ </td>
+</tr>
+<tr>
+ <th scope="row"><?php _e( 'Submitted on' ); ?></th>
+ <td>
+ <?php
+ /* translators: 2: comment date, 3: comment time */
+ printf( __( '<a href="%1$s">%2$s at %3$s</a>' ),
+ esc_url( get_comment_link( $comment->comment_ID ) ),
+ /* translators: comment date format. See http://php.net/date */
+ get_comment_date( __( 'Y/m/d' ) ),
+ get_comment_date( get_option( 'time_format' ) )
+ );
+ ?>
+ </td>
+</tr>
<tr>
<th scope="row"><?php /* translators: field name in comment form */ _ex('Comment', 'noun'); ?></th>
<td><?php echo $comment->comment_content; ?></td>
</tr>
</table>
-<p><?php _e('Are you sure you want to do this?'); ?></p>
+<form action="comment.php" method="get" class="comment-ays-submit">
-<form action='comment.php' method='get'>
-
-<table width="100%">
-<tr>
-<td><a class="button" href="<?php echo admin_url('edit-comments.php'); ?>"><?php esc_attr_e('No'); ?></a></td>
-<td class="textright"><?php submit_button( $button, 'button' ); ?></td>
-</tr>
-</table>
+<p>
+ <?php submit_button( $button, 'primary', 'submit', false ); ?>
+ <a href="<?php echo admin_url('edit-comments.php'); ?>" class="button-cancel"><?php esc_attr_e( 'Cancel' ); ?></a></td>
+</p>
<?php wp_nonce_field( $nonce_action ); ?>
-<input type='hidden' name='action' value='<?php echo esc_attr($formaction); ?>' />
-<input type='hidden' name='c' value='<?php echo esc_attr($comment->comment_ID); ?>' />
-<input type='hidden' name='noredir' value='1' />
+<input type="hidden" name="action" value="<?php echo esc_attr($formaction); ?>" />
+<input type="hidden" name="c" value="<?php echo esc_attr($comment->comment_ID); ?>" />
+<input type="hidden" name="noredir" value="1" />
</form>
-</div>
</div>
<?php
break;
wp_redirect( $redir );
die;
- break;
case 'editedcomment' :
wp_redirect( $location );
exit();
- break;
default:
wp_die( __('Unknown action.') );
- break;
} // end switch