mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Add option to require profile photo in profile form
This commit is contained in:
@@ -139,7 +139,15 @@
|
||||
|
||||
</select>
|
||||
</p>
|
||||
|
||||
|
||||
<p><label for="_um_profile_photo_required"><?php _e('Make Profile Photo Required','ultimatemember'); ?><?php $this->tooltip('Require user to update a profile photo when updating their profile', 'e'); ?></label>
|
||||
<span>
|
||||
|
||||
<?php $this->ui_on_off('_um_profile_photo_required'); ?>
|
||||
|
||||
</span>
|
||||
</p>
|
||||
|
||||
<p><label for="_um_profile_header_bg"><?php _e('Header Background Color','ultimatemember'); ?></label>
|
||||
<input type="text" value="<?php echo $ultimatemember->query->get_meta_value('_um_profile_header_bg', null, um_get_option('profile_header_bg') ); ?>" class="um-admin-colorpicker" name="_um_profile_header_bg" id="_um_profile_header_bg" data-default-color="<?php echo um_get_option('profile_header_bg'); ?>" />
|
||||
</p>
|
||||
|
||||
@@ -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