코드 관련문의

안녕하세요, 아래 코드를 추가하려고 하는데요.

 

add_filter('cosmosfarm_members_page_restriction', 'cosmosfarm_members_page_restriction_2020_03_13', 1, 1); function cosmosfarm_members_page_restriction_2020_03_13($page_restriction){ global $post; if($page_restriction && get_the_ID() == '1'){ // 실제 페이지 id로 적용해주세요. $current_user = wp_get_current_user(); $restriction_roles = get_post_meta($post->ID, 'cosmosfarm_members_page_restriction_roles', true); $this_restriction = true; foreach($current_user->roles as $role){ if(in_array($role, $restriction_roles)){ $this_restriction = false; break; } } if($this_restriction){ ?> <script> if(confirm('정기결제하신 후에 볼 수 있습니다.')){ window.location.href="페이지주소"; } </script> <?php exit; } } return $page_restriction; }

 

1. get_the_ID() == '1' 이 부분에서 페이지를 여러개로 지정이 안되나요?

 

2. '정기결제하신 후에 볼 수 있습니다.' 이 문구가 뜨지 않고 바로 정기결제 페이지로 넘어가게하려면 어떻게 해야하나요?

 

 

좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기
워드프레스 에러 기술지원 서비스 전문가에게 맡기세요
좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기