On this page
WP_Error::get_error_data( string|int $code = '' ): mixed
Retrieves the most recently added error data for an error code.
Parameters
$codestring|int Optional-
Error code.
Default:
''
Return
mixed Error data, if it exists.
Source
File: wp-includes/class-wp-error.php. View all references
public function get_error_data( $code = '' ) {
if ( empty( $code ) ) {
$code = $this->get_error_code();
}
if ( isset( $this->error_data[ $code ] ) ) {
return $this->error_data[ $code ];
}
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Error::get_error_code() wp-includes/class-wp-error.php | Retrieves the first error code available. |
Used By
| Used By | Description |
|---|---|
| login_header() wp-login.php | Output the login page header. |
Changelog
| Version | Description |
|---|---|
| 2.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_error/get_error_data