Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function my_restrict_access($can_access, $user_id, $post_id) {
- if( wp_fusion()->user->has_tag( 'yearly subscriber - one year' ) || wp_fusion()->user->has_tag( 'yearly subscriber - two years' ) ) {
- return true;
- }
- $user_access = get_user_meta( $user_id, 'user_access', true );
- // user_access is a string like "58,27,54,125"
- $user_access = explode(',', $user_access);
- if( $post_id == '1074' && in_array('58', $user_access) ) {
- // User has access to "58. The Changing Landscape of Australian Documentary",
- return true;
- }
- return false;
- }
- add_filter('wpf_user_can_access', 'my_restrict_access', 10, 3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement