is there a way to make the batch name be unique ? Do you guys have any code for this ?
client wants to create batches with different names (right now the batches can be added with the same name and only the slug is different).
Please try adding this given code in your wplms-customizer.php file in wplms customizer plugin :
add_filter('groups_group_name_before_save','mygroups_group_name_before_save',10,1);
function mygroups_group_name_before_save($group_name){
if (! bp_is_active( 'groups' ) )
return $group_name;
if ( bp_has_groups() ) :
while (bp_groups() ) : bp_the_group();
$name =bp_group_name() ;
if( $name =$group_name){
$error = "name already exists";
wp_die($error) ;
}
break;
endwhile;
endif;
}
Hi Alex,
i have not tried this code yet but I will.
Can you provide a similar code to make a Custom Profile Field be unique ?
e.g. I have a custom profile field named "student_license_number" (this is their Driver License number) and has to be unique. This is used in one of the registration forms ( Student Registration)
thanks.
You can use third party plugins available on wordpress.org for this .