WordPress at a glance
filter is not described

post_password_required filter-hook . WP 4.7.0

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

Usage

add_filter( 'post_password_required', 'filter_function_name_9013', 10, 2 );
function filter_function_name_9013( $required, $post ){
	// filter...

	return $required;
}
$required(true/false)
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 data.

Changelog

Since 4.7.0 Introduced.

Where the hook is called

post_password_required()
post_password_required
wp-includes/post-template.php 879
return apply_filters( 'post_password_required', $required, $post );
wp-includes/post-template.php 852
return apply_filters( 'post_password_required', false, $post );
wp-includes/post-template.php 857
return apply_filters( 'post_password_required', true, $post );

Where in WP core the hook is used

wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php 1771
add_filter( 'post_password_required', '__return_false' );
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php 1783
remove_filter( 'post_password_required', '__return_false' );
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 1670
add_filter( 'post_password_required', '__return_false' );
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 1708
remove_filter( 'post_password_required', '__return_false' );
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 318
add_filter( 'post_password_required', '__return_false' );
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 334
remove_filter( 'post_password_required', '__return_false' );
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 449
add_filter( 'post_password_required', '__return_false' );