GC_Error::get_all_error_data()
最后更新于:2021-11-27 14:43:02
GC_Error::get_all_error_data( string|int$code=”)Retrieves all error data for an error code in the order in which the data was added.
参数
- $code
-
(string|int) (Optional) Error code.
Default value: ”
响应
(mixed[]) Array of error data, if it exists.
源文件
文件: gc-includes/class-gc-error.php
public function get_all_error_data( $code = '' ) {
if ( empty( $code ) ) {
$code = $this->get_error_code();
}
$data = array();
if ( isset( $this->additional_data[ $code ] ) ) {
$data = $this->additional_data[ $code ];
}
if ( isset( $this->error_data[ $code ] ) ) {
$data[] = $this->error_data[ $code ];
}
return $data;
}