WPCrafter on "[Plugin: LifterLMS] Can you help with my custom function? Trying to do a redirect, but having a prob"

ساخت وبلاگ

I paid someone to create create the a function using the available lifter functions. What I needed was if a user tries to access a lesson they are not enrolled in, to redirect them. The function was working great, but under further inspection, I have found one problem.

The function is also doing this redirect when simply trying to view a course page.

Here is the function
add_filter( 'lifterlms_membership_restricted_message', function( $msg ) {
header ("location:/my-courses/");
}, 10, 1 );

add_filter( 'lifterlms_lesson_enrollment_restricted_message', function( $msg ) {
header ("location:/my-courses/");
}, 10, 1 );

I guess because the course is part of a membership, the membership restriction is kicking in even through they should still be able to view the course info.

I need this to work this way for a new template I am releasing for free for everyone. You can see kinda what I am doing here: http://www.wpcrafter.com/create-online-course-membership-website/

https://wordpress.org/plugins/lifterlms/

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 293 تاريخ : يکشنبه 3 مرداد 1395 ساعت: 5:55