• 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)
  • Do you want a way of checking in php code, or just to confirm it?

    Thread Starter sefran

    (@sefran)

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

    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.

    Thread Starter sefran

    (@sefran)

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

    Thread Starter sefran

    (@sefran)

    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.

    Thread Starter sefran

    (@sefran)

    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.