WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/post password required

Description

Whether post requires password and correct password has been provided.

Usage

<?php post_password_required$post ); ?>

Parameters

$post
(mixed) (Global $post variable) Either the post ID (integer) or the post object.
Default: None

Return Values

(boolean) 
False if a password is not required or the correct password cookie is present, true otherwise.

Changelog

Since: 2.7.0

Source File

post_password_required() is located in wp-includes/post-template.php.