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
This commit is contained in:
Rachel Baker 2016-01-30 21:55:32 +00:00
parent 07e07702ed
commit d95233cce9
1 changed files with 2 additions and 2 deletions

View File

@ -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( '<p>' . $comment->get_error_message() . '</p>', __( 'Comment Submission Failure' ), array( 'response' => $data, 'back_link' => true ) );
} else {
exit;
}