WPDev.one
Core Function
View Source on Trac ↗

post_password_required()

post_password_required( mixed $post = null )

Determines whether the post requires password and whether a correct password has been provided.

Parameters 1 required

Name / Type Description
(int

| WP_Post | null) $post An optional post. Global $post used if not provided.

Required

Return Value

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

Function Information

Since Version
2.7.0
Source File
wp-includes/post-template.php
Advertisement