set media lock based on membership

Home Forums General [ No Support Zone ] Feature Request set media lock based on membership

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #5807
    trapaniettech
    Spectator
    hi, it's possible to set media lock based on membership level ? what is the code to enable or disable the media lock ? thanks
    #5972
    trapaniettech
    Spectator
    you can hel me to create a function where set media lock based on membership ? in which file is located the function ?
    #6099
    trapaniettech
    Spectator
    i write this function and i recognize the process, but how inset to unset the unit lock IN ELSE STATEMENT ?
       add_filter('wplms_course_finished', 'check_if_the_user_is_free', 10, 5);
            add_filter('wplms_unit_mark_complete', 'check_if_the_user_is_free', 10, 5);
    
            function check_if_the_user_is_free($flag, $user_id) {
                //$unit_lock = vibe_get_option('nextunit_access');
                //$uno = "ciao1";
                //$due = "ciao2";
                //$stampavera = '<a href="#" id="next_unit" data-unit="' . $units[$next] . '" class="' . $class . '">' . __('Next Unit', 'vibe') . '</a>';
                $membership_ids = 4; //4 is the id of free membership level
                $user_id2 = get_current_user_id();
    
                if (!pmpro_hasmembershiplevel($membership_ids, $user_id2)) {
                    //return 1; // Continue with process
                    return 1;
                } else {
                  
                   // HOW I INSERT HERE TO UNSET THE LOCK UNIT AND SEE NEXT UNIT AND PREVOIUS UNIT ?????
                }
                return $flag;
            }
    #6993
    trapaniettech
    Spectator
    hi, can you help me ? thanks
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘set media lock based on membership’ is closed to new replies.