Advertisement
verygoodplugins

Untitled

Jan 22nd, 2019
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.39 KB | None | 0 0
  1. add_filter('wpf_user_can_access', 'restrict_post_categories', 10, 3);
  2.  
  3. function restrict_post_categories($can_access, $user_id, $post_id) {
  4.    
  5.     ​$tags = wp_fusion()->user->get_tags( $user_id );
  6.  
  7.     if( ( in_array('TagA', $tags) && in_array('TagB', $tags) && in_array('TagC', $tags) ) || in_array('TagD', $tags) || in_array('TagE', $tags) ) {
  8.         return false;
  9.     } else {
  10.         return true;
  11.     }
  12.  
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement