Support » Plugins » Hacks » is_private() exists?

  • asdfasdf_offline

    (@gangxtaboii)


    Hello everybody.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

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

    asdfasdf_offline

    (@gangxtaboii)

    thx a lot 🙂

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

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    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”.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘is_private() exists?’ is closed to new replies.