Title: If protected post function?
Last modified: August 18, 2016

---

# If protected post function?

 *  [aidymole](https://wordpress.org/support/users/aidymole/)
 * (@aidymole)
 * [18 years, 6 months ago](https://wordpress.org/support/topic/if-protected-post-function/)
 * Is there a way to find out if the current post handled by the loop is password
   protected?
    I want password protected post to be only visible to persons with
   editor capabilities…
 * Thanks a lot!

Viewing 1 replies (of 1 total)

 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [18 years, 6 months ago](https://wordpress.org/support/topic/if-protected-post-function/#post-646853)
 * You could perform a check on the post password record having a value:
 * `if( $post->post_password )`

Viewing 1 replies (of 1 total)

The topic ‘If protected post function?’ is closed to new replies.

## Tags

 * [functions](https://wordpress.org/support/topic-tag/functions/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [protected](https://wordpress.org/support/topic-tag/protected/)

 * 1 reply
 * 2 participants
 * Last reply from: [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * Last activity: [18 years, 6 months ago](https://wordpress.org/support/topic/if-protected-post-function/#post-646853)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
