diff --git a/wp-includes/class-wp-error.php b/wp-includes/class-wp-error.php
index 22273f8..2cd04aa 100644
a
|
b
|
public function __construct( $code = '', $message = '', $data = '' ) { |
56 | 56 | if ( empty($code) ) |
57 | 57 | return; |
58 | 58 | |
59 | | $this->errors[$code][] = $message; |
60 | | |
61 | | if ( ! empty($data) ) |
62 | | $this->error_data[$code] = $data; |
| 59 | $this->add( $code, $message, $data ); |
63 | 60 | } |
64 | 61 | |
65 | 62 | /** |
… |
… |
public function get_error_data($code = '') { |
166 | 163 | */ |
167 | 164 | public function add($code, $message, $data = '') { |
168 | 165 | $this->errors[$code][] = $message; |
169 | | if ( ! empty($data) ) |
170 | | $this->error_data[$code] = $data; |
| 166 | if ( ! empty($data) ){ |
| 167 | $this->add_data( $data, $code ); |
| 168 | } |
| 169 | |
| 170 | /** |
| 171 | * Fires when an error is added to a WP_Error object |
| 172 | * |
| 173 | * @param string|int $code Error code |
| 174 | * @param string $message Error message |
| 175 | * @param mixed $data Error data. Might be empty |
| 176 | * @param WP_Error $wp_error The WP_Error object |
| 177 | */ |
| 178 | do_action( 'wp_error_added', $code, $message, $data, $this ); |
171 | 179 | } |
172 | 180 | |
173 | 181 | /** |