Advertisement
verygoodplugins

Untitled

Apr 2nd, 2021
898
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1.         // Check the (not) tags on all visibility_by_role settings.
  2.         if ( ! empty( $tags_not ) ) {
  3.  
  4.             // Required tags (not).
  5.             $result = array_intersect( $tags_not, $user_tags );
  6.  
  7.             if ( empty( $result ) ) {
  8.                 $can_access = true;
  9.             }
  10.         }
  11.     } else {
  12.         // The user is not logged-in.
  13.         $can_access = true;
  14.     }
  15.  
  16.     $can_access = apply_filters(
  17.         'wpf_user_can_access_block',
  18.         $can_access,
  19.         $attributes
  20.     );
  21.  
  22.     $can_access = apply_filters(
  23.         'wpf_user_can_access',
  24.         $can_access,
  25.         wpf_get_current_user_id(),
  26.         false
  27.     );
  28.  
  29.     if ( $can_access ) {
  30.         return true;
  31.     } else {
  32.         return false;
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement