Make WordPress Core

Ticket #9144: dashboard.php.patch

File dashboard.php.patch, 617 bytes (added by Taimon, 15 years ago)
  • wp-admin/includes/dashboard.php

     
    420420                foreach ( $possible as $comment ) {
    421421                        if ( count( $comments ) >= 5 )
    422422                                break;
    423                         if ( in_array( $comment->comment_approved, $allowed_states ) )
    424                                 $comments[] = $comment;
     423                        if ( in_array( $comment->comment_approved, $allowed_states ) ) {
     424                                $post = get_post($comment->comment_post_ID);
     425                                if (($post->post_status !== 'private')
     426                                        || current_user_can('read_private_posts')
     427                                        || ($GLOBALS['current_user']->ID == $post->post_author))
     428                                        $comments[] = $comment;
     429                        }
    425430                }
    426431
    427432                $start = $start + 50;