Advertisement
verygoodplugins

Untitled

Apr 19th, 2020
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. function check_ld_access( $can_access, $user_id, $post_id ) {
  2.  
  3.     if ( ! function_exists( 'sfwd_lms_has_access' ) ) {
  4.         return $can_access;
  5.     }
  6.  
  7.     if ( 'sfwd-courses' == get_post_type( $post_id ) && false == sfwd_lms_has_access( $post_id, $user_id ) ) {
  8.         $can_access = false;
  9.     }
  10.  
  11.     return $can_access;
  12.  
  13. }
  14.  
  15. add_filter( 'wpf_user_can_access', 'check_ld_access', 10, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement