Changeset 43571 for trunk/src/wp-admin/comment.php
- Timestamp:
- 08/17/2018 01:50:26 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/comment.php
r42343 r43571 111 111 $nonce_action .= $comment_id; 112 112 113 ?>113 ?> 114 114 <div class="wrap"> 115 115 116 116 <h1><?php echo esc_html( $title ); ?></h1> 117 117 118 <?php119 switch ( $action ) {120 case 'spam':121 $caution_msg = __( 'You are about to mark the following comment as spam:' );122 $button = _x( 'Mark as Spam', 'comment' );123 break;124 case 'trash':125 $caution_msg = __( 'You are about to move the following comment to the Trash:' );126 $button = __( 'Move to Trash' );127 break;128 case 'delete':129 $caution_msg = __( 'You are about to delete the following comment:' );130 $button = __( 'Permanently Delete Comment' );131 break;132 default:133 $caution_msg = __( 'You are about to approve the following comment:' );134 $button = __( 'Approve Comment' );135 break;136 }137 138 if ( $comment->comment_approved != '0' ) { // if not unapproved139 $message = '';140 switch ( $comment->comment_approved ) {141 case '1':142 $message = __( 'This comment is currently approved.' );143 break;144 case 'spam':145 $message = __( 'This comment is currently marked as spam.' );146 break;147 case 'trash':148 $message = __( 'This comment is currently in the Trash.' );149 break;150 }151 if ( $message ) {152 echo '<div id="message" class="notice notice-info"><p>' . $message . '</p></div>';153 }154 }155 ?>118 <?php 119 switch ( $action ) { 120 case 'spam': 121 $caution_msg = __( 'You are about to mark the following comment as spam:' ); 122 $button = _x( 'Mark as Spam', 'comment' ); 123 break; 124 case 'trash': 125 $caution_msg = __( 'You are about to move the following comment to the Trash:' ); 126 $button = __( 'Move to Trash' ); 127 break; 128 case 'delete': 129 $caution_msg = __( 'You are about to delete the following comment:' ); 130 $button = __( 'Permanently Delete Comment' ); 131 break; 132 default: 133 $caution_msg = __( 'You are about to approve the following comment:' ); 134 $button = __( 'Approve Comment' ); 135 break; 136 } 137 138 if ( $comment->comment_approved != '0' ) { // if not unapproved 139 $message = ''; 140 switch ( $comment->comment_approved ) { 141 case '1': 142 $message = __( 'This comment is currently approved.' ); 143 break; 144 case 'spam': 145 $message = __( 'This comment is currently marked as spam.' ); 146 break; 147 case 'trash': 148 $message = __( 'This comment is currently in the Trash.' ); 149 break; 150 } 151 if ( $message ) { 152 echo '<div id="message" class="notice notice-info"><p>' . $message . '</p></div>'; 153 } 154 } 155 ?> 156 156 <div id="message" class="notice notice-warning"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php echo $caution_msg; ?></p></div> 157 157 … … 161 161 <td><?php comment_author( $comment ); ?></td> 162 162 </tr> 163 <?php if ( get_comment_author_email( $comment ) ) { ?>163 <?php if ( get_comment_author_email( $comment ) ) { ?> 164 164 <tr> 165 165 <th scope="row"><?php _e( 'Email' ); ?></th> … … 167 167 </tr> 168 168 <?php } ?> 169 <?php if ( get_comment_author_url( $comment ) ) { ?>169 <?php if ( get_comment_author_url( $comment ) ) { ?> 170 170 <tr> 171 171 <th scope="row"><?php _e( 'URL' ); ?></th> … … 176 176 <th scope="row"><?php /* translators: column name or table row header */ _e( 'In Response To' ); ?></th> 177 177 <td> 178 <?php178 <?php 179 179 $post_id = $comment->comment_post_ID; 180 if ( current_user_can( 'edit_post', $post_id ) ) {181 $post_link = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>";182 $post_link .= esc_html( get_the_title( $post_id ) ) . '</a>';183 } else {184 $post_link = esc_html( get_the_title( $post_id ) );185 }180 if ( current_user_can( 'edit_post', $post_id ) ) { 181 $post_link = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>"; 182 $post_link .= esc_html( get_the_title( $post_id ) ) . '</a>'; 183 } else { 184 $post_link = esc_html( get_the_title( $post_id ) ); 185 } 186 186 echo $post_link; 187 187 188 if ( $comment->comment_parent ) {189 $parent = get_comment( $comment->comment_parent );190 $parent_link = esc_url( get_comment_link( $parent ) );191 $name = get_comment_author( $parent );192 printf(193 /* translators: %s: comment link */194 ' | ' . __( 'In reply to %s.' ),195 '<a href="' . $parent_link . '">' . $name . '</a>'196 );197 }198 ?>188 if ( $comment->comment_parent ) { 189 $parent = get_comment( $comment->comment_parent ); 190 $parent_link = esc_url( get_comment_link( $parent ) ); 191 $name = get_comment_author( $parent ); 192 printf( 193 /* translators: %s: comment link */ 194 ' | ' . __( 'In reply to %s.' ), 195 '<a href="' . $parent_link . '">' . $name . '</a>' 196 ); 197 } 198 ?> 199 199 </td> 200 200 </tr> … … 202 202 <th scope="row"><?php _e( 'Submitted on' ); ?></th> 203 203 <td> 204 <?php204 <?php 205 205 /* translators: 1: comment date, 2: comment time */ 206 206 $submitted = sprintf( … … 210 210 get_comment_date( __( 'g:i a' ), $comment ) 211 211 ); 212 if ( 'approved' === wp_get_comment_status( $comment ) && ! empty( $comment->comment_post_ID ) ) {213 echo '<a href="' . esc_url( get_comment_link( $comment ) ) . '">' . $submitted . '</a>';214 } else {215 echo $submitted;216 }212 if ( 'approved' === wp_get_comment_status( $comment ) && ! empty( $comment->comment_post_ID ) ) { 213 echo '<a href="' . esc_url( get_comment_link( $comment ) ) . '">' . $submitted . '</a>'; 214 } else { 215 echo $submitted; 216 } 217 217 ?> 218 218 </td> … … 221 221 <th scope="row"><?php /* translators: field name in comment form */ _ex( 'Comment', 'noun' ); ?></th> 222 222 <td class="comment-content"> 223 <?php comment_text( $comment ); ?>223 <?php comment_text( $comment ); ?> 224 224 <p class="edit-comment"><a href="<?php echo admin_url( "comment.php?action=editcomment&c={$comment->comment_ID}" ); ?>"><?php esc_html_e( 'Edit' ); ?></a></p> 225 225 </td> … … 230 230 231 231 <p> 232 <?php submit_button( $button, 'primary', 'submit', false ); ?>232 <?php submit_button( $button, 'primary', 'submit', false ); ?> 233 233 <a href="<?php echo admin_url( 'edit-comments.php' ); ?>" class="button-cancel"><?php esc_html_e( 'Cancel' ); ?></a> 234 234 </p> 235 235 236 <?php wp_nonce_field( $nonce_action ); ?>236 <?php wp_nonce_field( $nonce_action ); ?> 237 237 <input type="hidden" name="action" value="<?php echo esc_attr( $formaction ); ?>" /> 238 238 <input type="hidden" name="c" value="<?php echo esc_attr( $comment->comment_ID ); ?>" /> … … 241 241 242 242 </div> 243 <?php243 <?php 244 244 break; 245 245 … … 291 291 'trashed' => '1', 292 292 'ids' => $comment_id, 293 ), $redir 293 ), 294 $redir 294 295 ); 295 296 break; … … 304 305 'spammed' => '1', 305 306 'ids' => $comment_id, 306 ), $redir 307 ), 308 $redir 307 309 ); 308 310 break;
Note: See TracChangeset
for help on using the changeset viewer.