Uses
Uses | Description |
---|---|
wp-includes/class-wp-error.php: WP_Error::get_error_code() | Retrieve first error code available. |
Add data for error code.
The error code can only contain one error data.
(mixed) (Required) Error data.
(string|int) (Optional) Error code.
Default value: ''
File: wp-includes/class-wp-error.php
public function add_data( $data, $code = '' ) { if ( empty( $code ) ) { $code = $this->get_error_code(); } $this->error_data[ $code ] = $data; }
Version | Description |
---|---|
2.1.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_error/add_data