diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:57:26 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:57:26 +0000 |
commit | 30883c26bdceb9eaf32c8d4a1b0c1bce223b5226 (patch) | |
tree | 39a02e2aeb21ab5b7923c6f5757d66d55b708912 /wp-admin/includes/dashboard.php | |
parent | Adding upstream version 6.4.3+dfsg1. (diff) | |
download | wordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.tar.xz wordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.zip |
Adding upstream version 6.5+dfsg1.upstream/6.5+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | wp-admin/includes/dashboard.php | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index 5b50423..2aeaa24 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -1088,7 +1088,11 @@ function wp_dashboard_recent_comments( $total_items = 5 ) { } foreach ( $possible as $comment ) { - if ( ! current_user_can( 'read_post', $comment->comment_post_ID ) ) { + if ( ! current_user_can( 'edit_post', $comment->comment_post_ID ) + && ( post_password_required( $comment->comment_post_ID ) + || ! current_user_can( 'read_post', $comment->comment_post_ID ) ) + ) { + // The user has no access to the post and thus cannot see the comments. continue; } @@ -1109,16 +1113,7 @@ function wp_dashboard_recent_comments( $total_items = 5 ) { echo '<ul id="the-comment-list" data-wp-lists="list:comment">'; foreach ( $comments as $comment ) { - $comment_post = get_post( $comment->comment_post_ID ); - if ( - current_user_can( 'edit_post', $comment->comment_post_ID ) || - ( - empty( $comment_post->post_password ) && - current_user_can( 'read_post', $comment->comment_post_ID ) - ) - ) { - _wp_dashboard_recent_comments_row( $comment ); - } + _wp_dashboard_recent_comments_row( $comment ); } echo '</ul>'; @@ -1577,7 +1572,11 @@ function wp_dashboard_primary() { * * @param string $link The widget's secondary link URL. */ - 'link' => apply_filters( 'dashboard_secondary_link', __( 'https://planet.wordpress.org/' ) ), + 'link' => apply_filters( + 'dashboard_secondary_link', + /* translators: Link to the Planet website of the locale. */ + __( 'https://planet.wordpress.org/' ) + ), /** * Filters the secondary feed URL for the 'WordPress Events and News' dashboard widget. @@ -1586,7 +1585,11 @@ function wp_dashboard_primary() { * * @param string $url The widget's secondary feed URL. */ - 'url' => apply_filters( 'dashboard_secondary_feed', __( 'https://planet.wordpress.org/feed/' ) ), + 'url' => apply_filters( + 'dashboard_secondary_feed', + /* translators: Link to the Planet feed of the locale. */ + __( 'https://planet.wordpress.org/feed/' ) + ), /** * Filters the secondary link title for the 'WordPress Events and News' dashboard widget. |