• Resolved Pawe? Knapek

    (@adpawl)


    Course Content Access set ON, but course content still locked for privigiled user (administrator/instructor).

    example in: templates/single/course-topics.php -possible in other files.
    global $is_enrolled;

    $is_privileged_user = tutor_utils()->has_user_course_content_access();

    $is_preview = get_post_meta( $post->ID, ‘_is_preview’, true );

    $is_public_course = \TUTOR\Course_List::is_public( $course_id );
    $is_locked = ! ( $is_enrolled || $is_preview || $is_public_course );

    is_locked condition don’t use $is_privileged_user

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Md Rashed Hossain

    (@wprashed)

    Hello @adpawl,

    I assume that there is a high possibility of conflict among other plugins. Can you kindly follow the steps mentioned below:

    1. Disable all the other third-party plugins and check whether that
    solves the issue
    2. If that solves the issue, please activate the plugins one by one to
    rule out the conflicting plugin
    3. If that doesn’t work, please check it by activating the parent theme
    4. If the issue still persists, please activate a WordPress default
    theme like Twenty Twenty and check

    Please also make sure that your platform and theme are up to date.

    Thread Starter Pawe? Knapek

    (@adpawl)

    Hello @wprashed

    No, no conflict. Tested on fresh install (only latest WP & Tutor)

    Look https://closeopinion.s4-tastewp.com/courses/test/ – course1/course2 lessons locked for non logged -ok.
    Now try: https://closeopinion.s4-tastewp.com/wp-admin
    user: test
    pass: RV9RwY3Zx@Nk3*WWXBCr9EcS

    And check again – still locked for admin.

    tutor/templates/single/course-topics.php ln. 82:
    $is_locked = ! ( $is_enrolled || $is_preview || $is_public_course );

    -This condition does not check whether current user is privileged.
    Well, no effect for settings “Course Content Access
    Allow instructors and admins to view the course content without enrolling

    fix example
    $is_privileged_user = tutor_utils()->has_user_course_content_access();
    $is_locked = ! ( $is_privileged_user || $is_enrolled || $is_preview || $is_public_course );

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.