diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 461918bd53..a3abfae9cf 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -4051,6 +4051,10 @@ function _json_wp_die_handler( $message, $title = '', $args = array() ) { 'additional_errors' => $parsed_args['additional_errors'], ); + if ( isset( $parsed_args['error_data'] ) ) { + $data['data']['error'] = $parsed_args['error_data']; + } + if ( ! headers_sent() ) { header( "Content-Type: application/json; charset={$parsed_args['charset']}" ); if ( null !== $parsed_args['response'] ) { @@ -4089,6 +4093,10 @@ function _jsonp_wp_die_handler( $message, $title = '', $args = array() ) { 'additional_errors' => $parsed_args['additional_errors'], ); + if ( isset( $parsed_args['error_data'] ) ) { + $data['data']['error'] = $parsed_args['error_data']; + } + if ( ! headers_sent() ) { header( "Content-Type: application/javascript; charset={$parsed_args['charset']}" ); header( 'X-Content-Type-Options: nosniff' ); @@ -4266,6 +4274,9 @@ function _wp_die_process_input( $message, $title = '', $args = array() ) { if ( empty( $title ) && is_array( $errors[0]['data'] ) && ! empty( $errors[0]['data']['title'] ) ) { $title = $errors[0]['data']['title']; } + if ( WP_DEBUG_DISPLAY && is_array( $errors[0]['data'] ) && ! empty( $errors[0]['data']['error'] ) ) { + $args['error_data'] = $errors[0]['data']['error']; + } unset( $errors[0] ); $args['additional_errors'] = array_values( $errors ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 256f9dbb50..9581a74971 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.5-alpha-57609'; +$wp_version = '6.5-alpha-57610'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.