Is there a built-in function that would allow me to restrict access to registered users until the official launch date in WordPress 3.4.2? The blog is self-hosted.
Leave a Reply
You must be logged in to post a comment.
Is there a built-in function that would allow me to restrict access to registered users until the official launch date in WordPress 3.4.2? The blog is self-hosted.
You must be logged in to post a comment.
This should do it. Place it in your theme’s
functions.php
or a plugin.You can still get to the login page like normal by going to “/wp-login.php” or “/wp-admin”.
Alternately, you could use
wp_safe_redirect
orwp_redirect
instead ofwp_die
to send people to a “Coming soon” page or something like that.There are numerous plugins that do this already. Search Google for: