WP_Error::get_error_data()
Retrieves the most recently added error data for an error code.
Method of the class: WP_Error{}
No Hooks.
Return
Mixed
. Error data, if it exists.
Usage
$WP_Error = new WP_Error(); $WP_Error->get_error_data( $code );
- $code(string|int)
- Error code.
Default: empty string
Changelog
Since 2.1.0 | Introduced. |
WP_Error::get_error_data() WP Error::get error data code WP 6.6.1
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 ]; } }