Bulk_Upgrader_Skin::error()
最后更新于:2021-11-25 19:22:38
Bulk_Upgrader_Skin::error( string|GC_Error$error)参数
- $error
-
(string|GC_Error) (Required)
源文件
文件: gc-admin/includes/class-bulk-upgrader-skin.php
public function error( $error ) {
if ( is_string( $error ) && isset( $this->upgrader->strings[ $error ] ) ) {
$this->error = $this->upgrader->strings[ $error ];
}
if ( is_gc_error( $error ) ) {
$messages = array();
foreach ( $error->get_error_messages() as $emessage ) {
if ( $error->get_error_data() && is_string( $error->get_error_data() ) ) {
$messages[] = $emessage . ' ' . esc_html( strip_tags( $error->get_error_data() ) );
} else {
$messages[] = $emessage;
}
}
$this->error = implode( ', ', $messages );
}
echo '<script type="text/javascript">jQuery('.waiting-' . esc_js( $this->upgrader->update_current ) . '').hide();</script>';
}