GC_Ajax_Upgrader_Skin::get_error_messages()
最后更新于:2021-11-26 09:13:02
GC_Ajax_Upgrader_Skin::get_error_messages()Retrieves a string for error messages.
响应
(string) Error messages during an upgrade.
源文件
文件: gc-admin/includes/class-gc-ajax-upgrader-skin.php
public function get_error_messages() {
$messages = array();
foreach ( $this->errors->get_error_codes() as $error_code ) {
$error_data = $this->errors->get_error_data( $error_code );
if ( $error_data && is_string( $error_data ) ) {
$messages[] = $this->errors->get_error_message( $error_code ) . ' ' . esc_html( strip_tags( $error_data ) );
} else {
$messages[] = $this->errors->get_error_message( $error_code );
}
}
return implode( ', ', $messages );
}