Support » Plugin: Ultimate Member - User Profile & Membership Plugin » Restrict access to entire post type?

  • Resolved Jon Fuller


    Is there a function or something I can implement, so that logged-out users do not have access to ANY “Poll” post type? I see I can add this on a per-post basis, but I need to prevent access to any existing or future posts from the Poll post type.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Champ Camba



    You can try the following code:

    function um_prevent_accessing_posts_types(){
         if( ! is_user_logged_in() && in_array( get_post_type(), array( 'poll','posts' ) ) ){
               wp_redirect( um_get_core_page('login') ); exit; 


    Perfect. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Restrict access to entire post type?’ is closed to new replies.