Title: Allow Users
Last modified: August 22, 2016

---

# Allow Users

 *  Resolved [Putte71](https://wordpress.org/support/users/patraven/)
 * (@patraven)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/allow-users/)
 * Hi Ben,
 * I spent some time yesterday trying to figure out why “Allow Users” does not work(
   v1.8). I came to the conclusion that there must be soemthing wrong in the code.
   I think is_user_logged_in is missing in the code. I got it to work using…
 * `if ( is_user_logged_in() && (bool) get_option( 'password_protected_administrators'))`
 * …in the Allow users function but since I am not a PHP-programmer I prefer if 
   you make a correct update of your code =)
 * If you check the original code you’ll see my point;
 *     ```
       /**
       	 * Allow Administrators
       	 *
       	 * @param   boolean  $bool  Allow administrators.
       	 * @return  boolean         True/false.
       	 */
       	function allow_administrators( $bool ) {
   
       		if ( ! is_admin() && current_user_can( 'manage_options' ) && (bool) get_option( 'password_protected_administrators' ) ) {
       			return 0;
       		}
   
       		return $bool;
   
       	}
   
       	/**
       	 * Allow Users
       	 *
       	 * @param   boolean  $bool  Allow administrators.
       	 * @return  boolean         True/false.
       	 */
       	function allow_users( $bool ) {
   
       		if ( ! is_admin() && current_user_can( 'manage_options' ) && (bool) get_option( 'password_protected_users' ) ) {
       			return 0;
       		}
   
       		return $bool;
   
       	}
       ```
   
 * Great plugin by the way! =)
 * Br,
    Pat!
 * [https://wordpress.org/plugins/password-protected/](https://wordpress.org/plugins/password-protected/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Ben Huson](https://wordpress.org/support/users/husobj/)
 * (@husobj)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/allow-users/#post-5581734)
 * Well spotted. Thank you.
 * I’ll fix and release an update.
 * Ben
 *  [Ben Huson](https://wordpress.org/support/users/husobj/)
 * (@husobj)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/allow-users/#post-5581749)
 * Should be fixed in version 1.9
 *  Thread Starter [Putte71](https://wordpress.org/support/users/patraven/)
 * (@patraven)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/allow-users/#post-5581795)
 * Super! =)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Allow Users’ is closed to new replies.

 * ![](https://ps.w.org/password-protected/assets/icon-128x128.gif?rev=2824217)
 * [Password Protected — Lock Entire Site, Pages, Posts, Categories, and Partial Content](https://wordpress.org/plugins/password-protected/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/password-protected/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/password-protected/)
 * [Active Topics](https://wordpress.org/support/plugin/password-protected/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/password-protected/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/password-protected/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Putte71](https://wordpress.org/support/users/patraven/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/allow-users/#post-5581795)
 * Status: resolved