Adds data to an error with the given code.
Parameters
$data
mixedrequired- Error data.
$code
string|intoptional- Error code.
Default:
''
Source
public function add_data( $data, $code = '' ) {
if ( empty( $code ) ) {
$code = $this->get_error_code();
}
if ( isset( $this->error_data[ $code ] ) ) {
$this->additional_data[ $code ][] = $this->error_data[ $code ];
}
$this->error_data[ $code ] = $data;
}
User Contributed Notes
You must log in before being able to contribute a note or feedback.