Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function check_custom_post_type( $can_access, $user_id, $post_id ) {
- if ( 'test' == get_post_type( $post_id ) ) {
- $client_id = get_field( 'client_name', $post_id );
- if ( $user_id != $client_id ) {
- $can_access = false;
- }
- }
- return $can_access;
- }
- add_filter( 'wpf_user_can_access', 'check_custom_post_type', 10, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement