Advertisement
verygoodplugins

Untitled

Nov 6th, 2019
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.36 KB | None | 0 0
  1.     public function user_can_access( $post_id, $user_id = false ) {
  2.  
  3.         if ( empty( $post_id ) ) {
  4.             return true;
  5.         }
  6.  
  7.         if ( $user_id == false ) {
  8.             $user_id = get_current_user_id();
  9.         }
  10.  
  11.         // If admins are excluded from restrictions
  12.         if ( wp_fusion()->settings->get( 'exclude_admins' ) == true && user_can( $user_id, 'manage_options' ) ) {
  13.             return true;
  14.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement