diff --git a/admin/templates/form/profile_customize.php b/admin/templates/form/profile_customize.php index d7d7bb05..162b074d 100644 --- a/admin/templates/form/profile_customize.php +++ b/admin/templates/form/profile_customize.php @@ -139,7 +139,15 @@
- + ++ + + ui_on_off('_um_profile_photo_required'); ?> + + +
+diff --git a/core/um-actions-form.php b/core/um-actions-form.php index 4156598c..96f11044 100644 --- a/core/um-actions-form.php +++ b/core/um-actions-form.php @@ -152,6 +152,10 @@ $form_id = $args['form_id']; $mode = $args['mode']; $fields = unserialize( $args['custom_fields'] ); + + if ( get_post_meta( $form_id, '_um_profile_photo_required', true ) && empty( $args['profile_photo'] ) ) { + $ultimatemember->form->add_error('profile_photo', sprintf(__('%s is required.','ultimatemember'), 'Profile Photo' ) ); + } if( isset( $fields ) && ! empty( $fields ) ){ foreach( $fields as $key => $array ) { diff --git a/core/um-actions-profile.php b/core/um-actions-profile.php index 2bd72d21..1366d4af 100644 --- a/core/um-actions-profile.php +++ b/core/um-actions-profile.php @@ -406,6 +406,12 @@ + + fields->is_error( 'profile_photo' ) ) { + echo $ultimatemember->fields->field_error( $ultimatemember->fields->show_error('profile_photo'), 'force_show' ); + } + ?>