Changeset 55630 for trunk/src/wp-admin/edit-comments.php
- Timestamp:
- 04/06/2023 04:42:40 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/edit-comments.php
r55414 r55630 33 33 $comment_status = wp_unslash( $_REQUEST['comment_status'] ); 34 34 $delete_time = wp_unslash( $_REQUEST['pagegen_timestamp'] ); 35 $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = %s AND %s > comment_date_gmt", $comment_status, $delete_time ) ); 35 $comment_ids = $wpdb->get_col( 36 $wpdb->prepare( 37 "SELECT comment_ID FROM $wpdb->comments 38 WHERE comment_approved = %s AND %s > comment_date_gmt", 39 $comment_status, 40 $delete_time 41 ) 42 ); 36 43 $doaction = 'delete'; 37 44 } elseif ( isset( $_REQUEST['delete_comments'] ) ) { … … 53 60 $deleted = 0; 54 61 55 $redirect_to = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'spammed', 'unspammed', 'approved', 'unapproved', 'ids' ), wp_get_referer() ); 62 $redirect_to = remove_query_arg( 63 array( 64 'trashed', 65 'untrashed', 66 'deleted', 67 'spammed', 68 'unspammed', 69 'approved', 70 'unapproved', 71 'ids', 72 ), 73 wp_get_referer() 74 ); 56 75 $redirect_to = add_query_arg( 'paged', $pagenum, $redirect_to ); 57 76 … … 287 306 } 288 307 289 if ( isset( $_REQUEST['approved'] ) || isset( $_REQUEST['deleted'] ) || isset( $_REQUEST['trashed'] ) || isset( $_REQUEST['untrashed'] ) || isset( $_REQUEST['spammed'] ) || isset( $_REQUEST['unspammed'] ) || isset( $_REQUEST['same'] ) ) { 308 if ( isset( $_REQUEST['approved'] ) 309 || isset( $_REQUEST['deleted'] ) 310 || isset( $_REQUEST['trashed'] ) 311 || isset( $_REQUEST['untrashed'] ) 312 || isset( $_REQUEST['spammed'] ) 313 || isset( $_REQUEST['unspammed'] ) 314 || isset( $_REQUEST['same'] ) 315 ) { 290 316 $approved = isset( $_REQUEST['approved'] ) ? (int) $_REQUEST['approved'] : 0; 291 317 $deleted = isset( $_REQUEST['deleted'] ) ? (int) $_REQUEST['deleted'] : 0; … … 298 324 if ( $approved > 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spammed > 0 || $unspammed > 0 || $same > 0 ) { 299 325 if ( $approved > 0 ) { 300 /* translators: %s: Number of comments. */ 301 $messages[] = sprintf( _n( '%s comment approved.', '%s comments approved.', $approved ), $approved ); 326 $messages[] = sprintf( 327 /* translators: %s: Number of comments. */ 328 _n( '%s comment approved.', '%s comments approved.', $approved ), 329 $approved 330 ); 302 331 } 303 332 304 333 if ( $spammed > 0 ) { 305 334 $ids = isset( $_REQUEST['ids'] ) ? $_REQUEST['ids'] : 0; 306 /* translators: %s: Number of comments. */ 307 $messages[] = sprintf( _n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ), $spammed ) . ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=unspam&ids=$ids", 'bulk-comments' ) ) . '">' . __( 'Undo' ) . '</a><br />'; 335 336 $messages[] = sprintf( 337 /* translators: %s: Number of comments. */ 338 _n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ), 339 $spammed 340 ) . sprintf( 341 ' <a href="%1$s">%2$s</a><br />', 342 esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=unspam&ids=$ids", 'bulk-comments' ) ), 343 __( 'Undo' ) 344 ); 308 345 } 309 346 310 347 if ( $unspammed > 0 ) { 311 /* translators: %s: Number of comments. */ 312 $messages[] = sprintf( _n( '%s comment restored from the spam.', '%s comments restored from the spam.', $unspammed ), $unspammed ); 348 $messages[] = sprintf( 349 /* translators: %s: Number of comments. */ 350 _n( '%s comment restored from the spam.', '%s comments restored from the spam.', $unspammed ), 351 $unspammed 352 ); 313 353 } 314 354 315 355 if ( $trashed > 0 ) { 316 356 $ids = isset( $_REQUEST['ids'] ) ? $_REQUEST['ids'] : 0; 317 /* translators: %s: Number of comments. */ 318 $messages[] = sprintf( _n( '%s comment moved to the Trash.', '%s comments moved to the Trash.', $trashed ), $trashed ) . ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=untrash&ids=$ids", 'bulk-comments' ) ) . '">' . __( 'Undo' ) . '</a><br />'; 357 358 $messages[] = sprintf( 359 /* translators: %s: Number of comments. */ 360 _n( '%s comment moved to the Trash.', '%s comments moved to the Trash.', $trashed ), 361 $trashed 362 ) . sprintf( 363 ' <a href="%1$s">%2$s</a><br />', 364 esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=untrash&ids=$ids", 'bulk-comments' ) ), 365 __( 'Undo' ) 366 ); 319 367 } 320 368 321 369 if ( $untrashed > 0 ) { 322 /* translators: %s: Number of comments. */ 323 $messages[] = sprintf( _n( '%s comment restored from the Trash.', '%s comments restored from the Trash.', $untrashed ), $untrashed ); 370 $messages[] = sprintf( 371 /* translators: %s: Number of comments. */ 372 _n( '%s comment restored from the Trash.', '%s comments restored from the Trash.', $untrashed ), 373 $untrashed 374 ); 324 375 } 325 376 326 377 if ( $deleted > 0 ) { 327 /* translators: %s: Number of comments. */ 328 $messages[] = sprintf( _n( '%s comment permanently deleted.', '%s comments permanently deleted.', $deleted ), $deleted ); 378 $messages[] = sprintf( 379 /* translators: %s: Number of comments. */ 380 _n( '%s comment permanently deleted.', '%s comments permanently deleted.', $deleted ), 381 $deleted 382 ); 329 383 } 330 384 … … 334 388 switch ( $comment->comment_approved ) { 335 389 case '1': 336 $messages[] = __( 'This comment is already approved.' ) . ' <a href="' . esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ) . '">' . __( 'Edit comment' ) . '</a>'; 390 $messages[] = __( 'This comment is already approved.' ) . sprintf( 391 ' <a href="%1$s">%2$s</a>', 392 esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ), 393 __( 'Edit comment' ) 394 ); 337 395 break; 338 396 case 'trash': 339 $messages[] = __( 'This comment is already in the Trash.' ) . ' <a href="' . esc_url( admin_url( 'edit-comments.php?comment_status=trash' ) ) . '"> ' . __( 'View Trash' ) . '</a>'; 397 $messages[] = __( 'This comment is already in the Trash.' ) . sprintf( 398 ' <a href="%1$s">%2$s</a>', 399 esc_url( admin_url( 'edit-comments.php?comment_status=trash' ) ), 400 __( 'View Trash' ) 401 ); 340 402 break; 341 403 case 'spam': 342 $messages[] = __( 'This comment is already marked as spam.' ) . ' <a href="' . esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ) . '">' . __( 'Edit comment' ) . '</a>'; 404 $messages[] = __( 'This comment is already marked as spam.' ) . sprintf( 405 ' <a href="%1$s">%2$s</a>', 406 esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ), 407 __( 'Edit comment' ) 408 ); 343 409 break; 344 410 } … … 346 412 } 347 413 348 echo '<div id="moderated" class="updated notice is-dismissible"><p>' . implode( "<br />\n", $messages ) . '</p></div>'; 414 printf( 415 '<div id="moderated" class="updated notice is-dismissible"><p>%s</p></div>', 416 implode( "<br />\n", $messages ) 417 ); 349 418 } 350 419 }
Note: See TracChangeset
for help on using the changeset viewer.