document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. function check_user_access( $p = null, $user_id = null ) {
  2.     if(empty($p))
  3.         $id = get_the_ID();
  4.     else
  5.         $id = is_string($p)?url_to_postid( $p ):$p;
  6.        
  7.     $access =  get_post_meta( $id, \'meta_restricting_access\' );
  8.     if(is_array($access[0]) && !empty($access[0])) {
  9.         foreach($access[0] as $a) {
  10.             if(check_user_role($a, $user_id))
  11.                 return true;
  12.         }
  13.         return false;
  14.     }
  15.     return true;
  16. }
');