diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index 4f2c9d1..a6b9e33 100644
|
a
|
b
|
function wp_send_json_error( $value = null, $status_code = null ) {
|
| 5520 | 5520 | 'data' => $value, |
| 5521 | 5521 | ); |
| 5522 | 5522 | |
| | 5523 | /* |
| | 5524 | * If no explicit status code was passed and the value is a WP_Error, |
| | 5525 | * attempt to derive the HTTP status code from the error data. |
| | 5526 | */ |
| | 5527 | if ( null === $status_code && is_wp_error( $value ) ) { |
| | 5528 | $error_data = $value->get_error_data(); |
| | 5529 | |
| | 5530 | if ( is_array( $error_data ) && isset( $error_data['status'] ) ) { |
| | 5531 | $status_code = (int) $error_data['status']; |
| | 5532 | } |
| | 5533 | } |
| | 5534 | |
| 5523 | 5535 | wp_send_json( $response, $status_code ); |
| 5524 | 5536 | } |