• Hello

    in my code I was used to programmatically enrol the user in some situations, here an extract of my code:

    $user = learn_press_get_user( $user_id,false );
    $user->enroll( $item_id, $order_id );

    But now it doesn’t work anymore as confirmed by the deprecation message that I found in the debug.log file:

    enroll is deprecated since version 4.1.0 with no alternative available

    Does “with no alternative available” mean that I have to trash all the systems that I build around your plugin? If so, it means all the websites that are implementing this system can not have the update of your plugin.
    I hope that deprecated message is a mistake and you have an alternative.

    Thank you in advance for your help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support brianvu-tp

    (@briantp)

    Hi,

    No, we didn’t support that code, because the code is old, not security and false some logic new, make some function run wrong as sending email v.v…

    We write a new function make improve performance, you can read code on the file inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php

    File function enroll_courses, purchase_course. You can send request via wp_remote_post or ajax js.

    thanks.

    Hi,

    Same issue here – can we get an example how to use the new function since we are programmatically enrolling now?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘not possible anymore to programmatically enrol user’ is closed to new replies.