WordPress.org

Make WordPress Core

Ticket #4332: 4332.4.diff

File 4332.4.diff, 646 bytes (added by rachelbaker, 4 years ago)

Using the backlink arg from wp_die

  • src/wp-comments-post.php

     
    1919
    2020$comment = wp_handle_comment_submission( wp_unslash( $_POST ) );
    2121if ( is_wp_error( $comment ) ) {
    22         $data = $comment->get_error_data();
     22        $data = intval( $comment->get_error_data() );
    2323        if ( ! empty( $data ) ) {
    24                 wp_die( $comment->get_error_message(), $data );
     24                wp_die( '<p>' . $comment->get_error_message() . '</p>', __( 'Comment Submission Failure' ), array( 'response' => $data, 'back_link' => true ) );
    2525        } else {
    2626                exit;
    2727        }