From 099b35933d1af299bc78c2096ff71b480025fa09 Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Sat, 30 Jan 2016 21:56:27 +0000 Subject: [PATCH] Comments: Add a back link to `wp_die()` comment form submission error display. Fixes #4332. Props wonderboymusic, westonruter, shamess, rachelbaker. Built from https://develop.svn.wordpress.org/trunk@36424 git-svn-id: http://core.svn.wordpress.org/trunk@36391 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-comments-post.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-comments-post.php b/wp-comments-post.php index 2fb148a8dc..4fb249badb 100644 --- a/wp-comments-post.php +++ b/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; } diff --git a/wp-includes/version.php b/wp-includes/version.php index a49200f7e4..e757f07fb1 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-alpha-36423'; +$wp_version = '4.5-alpha-36424'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.