GC_Error::copy_errors()
最后更新于:2021-11-27 14:42:39
GC_Error::copy_errors( GC_Error$from, GC_Error$to)Copies errors from one GC_Error instance to another.
参数
- $from
- $to
源文件
文件: gc-includes/class-gc-error.php
protected static function copy_errors( GC_Error $from, GC_Error $to ) {
foreach ( $from->get_error_codes() as $code ) {
foreach ( $from->get_error_messages( $code ) as $error_message ) {
$to->add( $code, $error_message );
}
foreach ( $from->get_all_error_data( $code ) as $data ) {
$to->add_data( $data, $code );
}
}
}