mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 21:08:44 +01:00
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:
parent
07e07702ed
commit
d95233cce9
@ -19,9 +19,9 @@ nocache_headers();
|
|||||||
|
|
||||||
$comment = wp_handle_comment_submission( wp_unslash( $_POST ) );
|
$comment = wp_handle_comment_submission( wp_unslash( $_POST ) );
|
||||||
if ( is_wp_error( $comment ) ) {
|
if ( is_wp_error( $comment ) ) {
|
||||||
$data = $comment->get_error_data();
|
$data = intval( $comment->get_error_data() );
|
||||||
if ( ! empty( $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 {
|
} else {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user