mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-18 14:13:46 +09:00
Add option to require profile photo in profile form
This commit is contained in:
@@ -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 ) {
|
||||
|
||||
@@ -406,6 +406,12 @@
|
||||
<?php do_action('um_after_header_meta', um_user('ID'), $args ); ?>
|
||||
|
||||
</div><div class="um-clear"></div>
|
||||
|
||||
<?php
|
||||
if ( $ultimatemember->fields->is_error( 'profile_photo' ) ) {
|
||||
echo $ultimatemember->fields->field_error( $ultimatemember->fields->show_error('profile_photo'), 'force_show' );
|
||||
}
|
||||
?>
|
||||
|
||||
<?php do_action('um_after_header_info', um_user('ID'), $args); ?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user