wp/wp-admin/comment.php
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
    41 	$comment    = get_comment( $comment_id );
    41 	$comment    = get_comment( $comment_id );
    42 
    42 
    43 	// Prevent actions on a comment associated with a trashed post.
    43 	// Prevent actions on a comment associated with a trashed post.
    44 	if ( $comment && 'trash' === get_post_status( $comment->comment_post_ID ) ) {
    44 	if ( $comment && 'trash' === get_post_status( $comment->comment_post_ID ) ) {
    45 		wp_die(
    45 		wp_die(
    46 			__( 'You can’t edit this comment because the associated post is in the Trash. Please restore the post first, then try again.' )
    46 			__( 'You cannot edit this comment because the associated post is in the Trash. Please restore the post first, then try again.' )
    47 		);
    47 		);
    48 	}
    48 	}
    49 } else {
    49 } else {
    50 	$comment = null;
    50 	$comment = null;
    51 }
    51 }
    52 
    52 
    53 switch ( $action ) {
    53 switch ( $action ) {
    54 
    54 
    55 	case 'editcomment':
    55 	case 'editcomment':
       
    56 		// Used in the HTML title tag.
    56 		$title = __( 'Edit Comment' );
    57 		$title = __( 'Edit Comment' );
    57 
    58 
    58 		get_current_screen()->add_help_tab(
    59 		get_current_screen()->add_help_tab(
    59 			array(
    60 			array(
    60 				'id'      => 'overview',
    61 				'id'      => 'overview',
    94 
    95 
    95 	case 'delete':
    96 	case 'delete':
    96 	case 'approve':
    97 	case 'approve':
    97 	case 'trash':
    98 	case 'trash':
    98 	case 'spam':
    99 	case 'spam':
       
   100 		// Used in the HTML title tag.
    99 		$title = __( 'Moderate Comment' );
   101 		$title = __( 'Moderate Comment' );
   100 
   102 
   101 		if ( ! $comment ) {
   103 		if ( ! $comment ) {
   102 			wp_redirect( admin_url( 'edit-comments.php?error=1' ) );
   104 			wp_redirect( admin_url( 'edit-comments.php?error=1' ) );
   103 			die();
   105 			die();