Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function check_user_access( $p = null, $user_id = null ) {
- if(empty($p))
- $id = get_the_ID();
- else
- $id = is_string($p)?url_to_postid( $p ):$p;
- $access = get_post_meta( $id, 'meta_restricting_access' );
- if(is_array($access[0]) && !empty($access[0])) {
- foreach($access[0] as $a) {
- if(check_user_role($a, $user_id))
- return true;
- }
- return false;
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment