Make WordPress Core


Ignore:
Timestamp:
01/30/2016 09:55:32 PM (9 years ago)
Author:
rachelbaker
Message:

Comments: Add a back link to wp_die() comment form submission error display.

Fixes #4332.

Props wonderboymusic, westonruter, shamess, rachelbaker.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-comments-post.php

    r34799 r36424  
    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;
Note: See TracChangeset for help on using the changeset viewer.