Is this a mistake?
-
Hi LearnPress Team,
I was using this action “learn-press/user-course-finished” and it was triggering correctly from finish_course function in wp-content\plugins\learnpress\inc\user\abstract-lp-user.php:657 (version: 4.2.7.5)
After last two release, this function is not being called anymore and now there is this new function called handle_finish in wp-content\plugins\learnpress\inc\Models\UserItems\UserCourseModel.php:926 (version: 4.2.7.6+)
This function has that same hook in the if condition:
// Hook old
if ( has_filter( 'learn-press/user-course/finish' ) ) {
do_action( 'learn-press/user-course-finished', $this->ref_id, $this->user_id, null );
}But I think it should be:
// Hook old
if ( has_filter( 'learn-press/user-course/finished' ) ) {
do_action( 'learn-press/user-course-finished', $this->item_id, $this->user_id, null );
}In this old code, Course ID was being passed as first parameter but now it is passing a $this->ref_id which is a Order ID.
I want to use that function, is this a mistake or should I adapt my code?
Are you guys using Slack or Discord?
Regards,
Saurabh
- You must be logged in to reply to this topic.