is_private() exists? (4 posts)

  1. Offline
    Posted 5 years ago #

    Hello everybody.

    Does a function exists which checks if the current post/page is private or protected? thx a lot :)

  2. post_password_required() will return true if the post requires a password *and* the user has not given the correct password already. False otherwise.

  3. Offline
    Posted 5 years ago #

    thx a lot :)

    and this also works for private pages/posts? or only for password-protected?

  4. Only for password protected. If you want to check for private posts, look at the $post->post_status and see if it's set to "private".

Topic Closed

This topic has been closed to new replies.

About this Topic