post_password_required WordPress Filter Hook

The post_password_required hook is fired when a post is password protected and the visitor is not logged in. This hook can be used to customise the password protection form or to display a message to the visitor.

apply_filters( 'post_password_required', bool $required, WP_Post $post ) #

Filters whether a post requires the user to supply a password.


Parameters

$required

(bool)Whether the user needs to supply a password. True if password has not been provided or is incorrect, false if password has been supplied or is not required.

$post

(WP_Post)Post object.


Top ↑

Source

File: wp-includes/post-template.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.