post_password_required

This filter is documented in wp-includes/post.php.

Description

apply_filters( 'post_password_required', (bool) $false, (unknown) $post ); 

Parameters (2)

0. $false (bool) => false
The false.
1. $post (unknown)
The post.

Usage

To run the hook, copy the example below.
  1. $false = apply_filters( 'post_password_required', $false, $post ); 
  2.  
  3. if ( !empty( $false ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the post_password_required callback 
  2. function filter_post_password_required( $false, $post ) { 
  3. // make filter magic happen here... 
  4. return $false
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'post_password_required', 'filter_post_password_required', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'post_password_required', 'filter_post_password_required', 10, 2 ); 

Defined (10)

The filter is defined in the following location(s).

/wp-includes/post-template.php  
  1. return apply_filters( 'post_password_required', false, $post ); 
  1. return apply_filters( 'post_password_required', true, $post ); 
  1. return apply_filters( 'post_password_required', $required, $post ); 
/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php  
  1. add_filter( 'post_password_required', '__return_false' ); 
  1. remove_filter( 'post_password_required', '__return_false' ); 
/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php  
  1. add_filter( 'post_password_required', '__return_false' ); 
  1. remove_filter( 'post_password_required', '__return_false' ); 
  1. add_filter( 'post_password_required', '__return_false' ); 
  1. add_filter( 'post_password_required', '__return_false' ); 
  1. remove_filter( 'post_password_required', '__return_false' );