Created
November 13, 2018 09:08
-
-
Save nikitasinelnikov/d78a20417764a59ebec29a5353af5229 to your computer and use it in GitHub Desktop.
Makes Bio field required
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'um_add_error_on_form_submit_validation', 'um_form_submit_profile_bio_required', 10, 3 ); | |
function um_form_submit_profile_bio_required( $array, $key, $args ) { | |
if ( ! empty( $args[ 'show_bio' ] ) ) { | |
if ( empty( $args['description'] ) ) { | |
UM()->form()->add_error( 'description', __( 'This field is required', 'ultimate-member' ) ); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment