GC_Error::add_data()
最后更新于:2021-11-27 14:42:24
GC_Error::add_data( mixed$data, string|int$code=”)Adds data to an error with the given code.
参数
- $data
-
(mixed) (Required) Error data.
- $code
-
(string|int) (Optional) Error code.
Default value: ”
源文件
文件: gc-includes/class-gc-error.php
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;
}