From 8205cb9270961f6fefe36414b36610134104d02b Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Mon, 8 Aug 2016 19:05:14 +0800 Subject: [PATCH] Fix biography character limit when added in form --- core/um-actions-form.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/um-actions-form.php b/core/um-actions-form.php index 6b805ff4..dec25fb4 100644 --- a/core/um-actions-form.php +++ b/core/um-actions-form.php @@ -443,10 +443,16 @@ } if ( isset( $args['description'] ) ) { + $max_chars = um_get_option('profile_bio_maxchars'); - if ( strlen( utf8_decode( $args['description'] ) ) > $max_chars && $max_chars ) { - $ultimatemember->form->add_error('description', sprintf(__('Your user description must contain less than %s characters','ultimatemember'), $max_chars ) ); + $profile_show_bio = um_get_option('profile_show_bio'); + + if( $profile_show_bio ){ + if ( strlen( utf8_decode( $args['description'] ) ) > $max_chars && $max_chars ) { + $ultimatemember->form->add_error('description', sprintf(__('Your user description must contain less than %s characters','ultimatemember'), $max_chars ) ); + } } + } } // end if ( isset in args array )