From d95233cce9ca001a04f9f982ceee5c701f6ed141 Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Sat, 30 Jan 2016 21:55:32 +0000 Subject: [PATCH] Comments: Add a back link to `wp_die()` comment form submission error display. Fixes #4332. Props wonderboymusic, westonruter, shamess, rachelbaker. git-svn-id: https://develop.svn.wordpress.org/trunk@36424 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-comments-post.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-comments-post.php b/src/wp-comments-post.php index 2fb148a8dc..4fb249badb 100644 --- a/src/wp-comments-post.php +++ b/src/wp-comments-post.php @@ -19,9 +19,9 @@ nocache_headers(); $comment = wp_handle_comment_submission( wp_unslash( $_POST ) ); if ( is_wp_error( $comment ) ) { - $data = $comment->get_error_data(); + $data = intval( $comment->get_error_data() ); if ( ! empty( $data ) ) { - wp_die( $comment->get_error_message(), $data ); + wp_die( '

' . $comment->get_error_message() . '

', __( 'Comment Submission Failure' ), array( 'response' => $data, 'back_link' => true ) ); } else { exit; }