- fixed required field "image". Does not work check, if you delete the previously uploaded image when you update the profile again

This commit is contained in:
Denis Baranov
2018-03-02 17:35:42 +02:00
parent e57a6fa070
commit 2e619ae995
+6 -6
View File
@@ -269,12 +269,12 @@ if ( ! defined( 'ABSPATH' ) ) exit;
if ( isset( $args[$key] ) ) {
if ( isset( $array['required'] ) && $array['required'] == 1 ) {
if ( ! isset( $args[$key] ) || $args[$key] == '' ) {
if( empty( $array['label'] ) ) {
UM()->form()->add_error($key, __('This field is required','ultimate-member') );
} else {
UM()->form()->add_error($key, sprintf( __('%s is required','ultimate-member'), $array['label'] ) );
}
if ( ! isset( $args[$key] ) || $args[$key] == '' || $args[$key] == 'empty_file') {
if( empty( $array['label'] ) ) {
UM()->form()->add_error($key, __('This field is required','ultimate-member') );
} else {
UM()->form()->add_error($key, sprintf( __('%s is required','ultimate-member'), $array['label'] ) );
}
}
}