How can I force the user subscribe in all courses programmatically

Home Forums Legacy Support Support queries How-to & Troubleshooting How can I force the user subscribe in all courses programmatically

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #365434
    mirador360
    Spectator
    hi, i wanna know how can I force the user subscribe in all courses programmatically? I know there is a function that does this in LMS->settings only I'm not using your login system so I need to apply the same function to my login. In other words, when the user registers in my login I need to trigger an event or trigger that makes the user who is registering automatically subscribe to all existing courses... can you help me?
    #365512
    Veronica
    Moderator
    hi well there are three hooks
    add_action('bp_core_activated_user',array($this,'wplms_activate_free_courses'),99); 
    						add_action('vibebp_user_registered',array($this,'wplms_activate_free_courses'),99,1);
    						add_action('user_register',array($this,'wplms_activate_free_courses'),99,1);
    that we are using to perform the above scenario and we are not assigning course on login we are performing this on user registration use this: do_action('user_register',$user_id); and make your courses free and enable the setting it will work
    #365717
    mirador360
    Spectator
    hi, thanks for your reply.. can you give me an example applicating this code ?
    #365819
    mirador360
    Spectator
    hi i managed to do this, thank you can close the topic!
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘How can I force the user subscribe in all courses programmatically’ is closed to new replies.