How to set up a private custom post type that is accessible in the administrative dashboard?
For the frontend, you can use template_redirect action to identify the page, and perform redirects or adjust the request on the fly (untested): add_action( ‘template_redirect’, static function () { if ( ! is_singular( ‘cpt’ ) && ! is_post_type_archive( ‘cpt’ ) ) { return; } if ( current_user_can( ‘read_private_pages’ ) || current_user_can( ‘read_private_posts’ ) ) { … Read more