How To Check If The User Registration Is Allowed

In one of my previous posts, I have already shared a code snippet to check if a WordPress user is logged in or not. In this post, we are going to check if the user registration in enabled on a WordPress Website. To do this we are going to use get_option method.

To check if user registration is allowed or not, use the following code snippet.

if ( get_option( 'users_can_register' ) ) {
    // Use Registration is enabled.
}

 

Leave a Comment.