WordPress.org

Ready to get started?Download WordPress

Forums

post_password_required() not working (4 posts)

  1. David Gard
    Member
    Posted 2 years ago #

    Hi all,

    I have added custom fields to the Media area of WP to add a password to an attachment (working), but when I enter the password WP is telling me that the the password is still required.

    $wp_password_required = post_password_required($post->ID);
    if($wp_password_required) :
    	echo get_the_password_form();
    else :
    	get_template_part( 'loop', 'attachment' );
    endif;

    I've looked in the $_COOKIE variable, and the correct password is being assigned to the wp-postpass_#### key, but for some reason it does not like what is in there.

    Am I doing something wrong?

    Thanks.

  2. chazbeaner
    Member
    Posted 2 years ago #

    Just started having the same issue. The cookie is being set correctly, but the function no longer seems to recognize that the cookie is present.

    Did you find anything out about this? If not, then maybe this bump will get some answers.

  3. Drew Baker
    Member
    Posted 2 years ago #

    As of 3.4 "post_password_required()" no longer works for me too.

    The password form in TwentyEleven works though. I have no plugins turned on.

  4. Drew Baker
    Member
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.