mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Fixed unique key field validation
This commit is contained in:
@@ -365,6 +365,25 @@
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'unique_value':
|
||||
|
||||
if ( $args[$key] != '' ) {
|
||||
|
||||
$args_unique_meta = array(
|
||||
'meta_key' => $key,
|
||||
'meta_value' => $args[ $key ],
|
||||
'compare' => '=',
|
||||
'exclude' => array( $args['user_id'] ),
|
||||
);
|
||||
|
||||
$meta_key_exists = get_users( $args_unique_meta );
|
||||
|
||||
if( $meta_key_exists ){
|
||||
$ultimatemember->form->add_error( $key , __('You must provide a unique value','ultimatemember') );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user