From d588cf14c97b93b57e62a26689197f605abdf6f7 Mon Sep 17 00:00:00 2001 From: Shramee Srivastav Date: Thu, 3 Mar 2016 17:28:56 +0530 Subject: [PATCH] Make User Tags field required option work --- core/um-actions-form.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/um-actions-form.php b/core/um-actions-form.php index 253ab682..4156598c 100644 --- a/core/um-actions-form.php +++ b/core/um-actions-form.php @@ -162,6 +162,10 @@ $ultimatemember->form->add_error($key, sprintf(__('%s is required.','ultimatemember'), $array['title'] ) ); } + if ( isset( $array['type'] ) && $array['type'] == 'user_tags' && isset( $array['required'] ) && $array['required'] == 1 && !isset( $args[$key] ) ) { + $ultimatemember->form->add_error($key, sprintf(__('%s is required.','ultimatemember'), $array['title'] ) ); + } + if ( isset( $array['type'] ) && $array['type'] == 'radio' && isset( $array['required'] ) && $array['required'] == 1 && !isset( $args[$key] ) && !in_array($key, array('role_radio','role_select') ) ) { $ultimatemember->form->add_error($key, sprintf(__('%s is required.','ultimatemember'), $array['title'] ) ); }