When a user registers, I have a section where the student selects their role. There are 3 roles.
I have also created 3 course batches which contain courses for those 3 user roles. Is there a way to have these course batches auto assigned to the user on registration, depending on whichever role they have selected?
Thanks
I saw an article with this code to auto add users to free courses -
function wplms_activate_free_courses($user_id = NULL){
if(empty($user_id)){
if(!is_user_logged_in())
return;
$user_id = get_current_user_id();
}
if ( bp_account_was_activated() ){ // Checks if the Account was activated
$args = array(
'post_type' => 'course',
'post_per_page' => -1,
'meta_query'=>array(
array(
'key' => 'vibe_course_free',
'value' => 'S',
'compare' => '=',
'type' => 'CHAR'
)
)
);
$free_courses = new WP_Query($args);
if($free_courses->have_posts()){
while($free_courses->have_posts()){
the_post();
$course_id = get_the_ID();
bp_course_add_user_to_course($user_id,$course_id);
}
}
wp_reset_postdata();
}
}
-------
I'm wondering if I can apply this logic to the functionality I am looking for?
Hi...
Please confirm which registration form are you using ?
Are you using buddypress registration form or wplms registration form ?
This can be done via custom code.
Let me know which profile field you have created in your website, its ID, field name and the batches that should be connected to these fields.
Please explain it in details .
I have created a profile field called "Confirm You are a Patient" with one value, "Patient".
I would like to have the batch called "Patient Courses" to be auto assigned to those users.
This reply has been marked as private.
This reply has been marked as private.
This reply has been marked as private.
If I added more fields and wanted to add different batches to them, how would I refactor the code? How do I locate the group ids?
This reply has been marked as private.
This reply has been marked as private.
Is there a time table on when this feature will be added?
If it's not anywhere in the near future, I need to be able to custom code it. This feature is necessary for my needs
We are hopping to release the update within a week or maximum 2 weeks.