Support » Everything else WordPress » protected post

  • Hi.
    Is there a function call (or anything else way) to verify that a post is protected?
    Thanks in advance.

Viewing 6 replies - 1 through 6 (of 6 total)
  • mrmist


    Forum Janitor

    Do you want a way of checking in php code, or just to confirm it?

    I want to check it in php code so that I can do something if the post is protected or not.



    Forum Janitor

    In a WordPress plugin or similar you could use post_password_required(postid)

    Outside of that, if you google for post_password_required you can find the code behind it (which is in wp-includes/post-template.php) and go from there.

    Thank you very much. The post_password_required(postid) is perfect.

    From which WP version post_password_required(postid) works?
    From 2.7.1. Confirm?
    I have an “undefined function post_password_required()” message when I try my plugin with WP 2.7, while it works with WP 2.7.1.

    Sorry… it works well also with WP 2.7 version, I was trying with an older version.
    The post_password_required() is defined from WP 2.7 version.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘protected post’ is closed to new replies.