Make WordPress Core


Ignore:
Timestamp:
01/15/2024 05:40:06 PM (9 months ago)
Author:
SergeyBiryukov
Message:

Comments: Use post_password_required() for comment capability checks.

Follow-up to [56836], [57123].

Fixes #59929.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/dashboard.php

    r57123 r57285  
    10891089
    10901090        foreach ( $possible as $comment ) {
    1091             $comment_post = get_post( $comment->comment_post_ID );
    1092 
    10931091            if ( ! current_user_can( 'edit_post', $comment->comment_post_ID )
    1094                 && ( ! empty( $comment_post->post_password )
     1092                && ( post_password_required( $comment->comment_post_ID )
    10951093                    || ! current_user_can( 'read_post', $comment->comment_post_ID ) )
    10961094            ) {
Note: See TracChangeset for help on using the changeset viewer.