post_password_required

post_password_required

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('post_password_required') is found 3 times:

  • /wp-includes/post-template.php line 877
    873
    874
    875
    876
    877
    878
    879
    880
    881
    882
    883
    $post = get_post( $post );
     
    if ( empty( $post->post_password ) ) {
        /** This filter is documented in wp-includes/post-template.php */
        return apply_filters( 'post_password_required', false, $post );
    }
     
    if ( ! isset( $_COOKIE[ 'wp-postpass_' . COOKIEHASH ] ) ) {
        /** This filter is documented in wp-includes/post-template.php */
        return apply_filters( 'post_password_required', true, $post );
    }
  • /wp-includes/post-template.php line 882
    878
    879
    880
    881
    882
    883
    884
    885
    886
    887
    888
    }
     
    if ( ! isset( $_COOKIE[ 'wp-postpass_' . COOKIEHASH ] ) ) {
        /** This filter is documented in wp-includes/post-template.php */
        return apply_filters( 'post_password_required', true, $post );
    }
     
    require_once ABSPATH . WPINC . '/class-phpass.php';
    $hasher = new PasswordHash( 8, true );
     
    $hash = wp_unslash( $_COOKIE[ 'wp-postpass_' . COOKIEHASH ] );
  • /wp-includes/post-template.php line 904
    900
    901
    902
    903
    904
    905
    906
    907
    908
    909
         * @param bool    $required 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.
         * @param WP_Post $post     Post object.
         */
        return apply_filters( 'post_password_required', $required, $post );
    }
     
    //
    // Page Template Functions for usage in Themes.
    //

See this hook used in plugins: