certificate with membership (hide all related strings according to membership)

Home Forums General [ No Support Zone ] Feature Request certificate with membership (hide all related strings according to membership)

Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1153
    trapaniettech
    Spectator
    hi there, i post this discussion 2 days ago : https://wplms.io/support/forums/topic/certificate-with-membership/   i need to hide all related strings (certificate, badge) according to membership; it's possible ? see this image : http://pregiblog.it/corsionline/wp-content/uploads/2015/09/12.gif thanks for support
    #1158
    MrVibe
    Keymaster
    Few questions : a. What happens when a non-logged in user views the course ? Does she see the badge or certificate icon ? Assumption : Does not see b. What happens when a user who has the membership level to view certificates and badges sees the course ? Assumption : See This is a customisation, yes it is possible, but you need to know the membership levels. For example : You want to display certificate and Badge information to users with "23" membership id : Add code in child theme - functions.php :  
    add_filter('wplms_course_details_widget','show_hide_features_based_on_membership_level');
    
    function show_hide_features_based_on_membership_level($details){
    
    $user_id = get_current_user_id();
    
    $membership_levels = 23; //integer or array(24,34);
    
    if(!pmpro_hasmembershiplevel($membership_levels,$user_id)){
    
    unset($details['certificate']); //hides certificate
    
    unset($details['badge']); //hides certificate
    
    }
    
    return $details
    
    }
    #1172
    trapaniettech
    Spectator
    hi, thanks.... but i receive an error : http://prntscr.com/8leslb thanks
    #1176
    trapaniettech
    Spectator
    sorry, my error.... if i would to insert more membership id how i do ? http://prntscr.com/8lfamr thanks we're amazing
    #1181
    MrVibe
    Keymaster
    For more membership ids you need to use
    
    
    $membership_levels = array(23,34);
    
    
    #1186
    trapaniettech
    Spectator
    fantastic thanks
Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘certificate with membership (hide all related strings according to membership)’ is closed to new replies.