Summery Summery
Add data for error code.
Syntax Syntax
Description Description
The error code can only contain one error data.
Parameters Parameters
- $data
-
(Required) Error data.
- $code
-
(Optional) Error code.
Default value: ''
Source Source
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; }
Advertisement
Changelog Changelog
Version | Description |
---|---|
2.1.0 | Introduced. |