WordPress.org

Ready to get started?Download WordPress

Forums

is_private() exists? (4 posts)

  1. Offline
    Member
    Posted 3 years ago #

    Hello everybody.

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

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 3 years ago #

    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
    Member
    Posted 3 years ago #

    thx a lot :)

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

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 3 years ago #

    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