WordPress.org

Make WordPress Core

Ticket #3478: 3478-index.patch

File 3478-index.patch, 846 bytes (added by pishmishy, 7 years ago)
  • wp-admin/index.php

     
    3333<div id="incominglinks"></div> 
    3434 
    3535<?php 
    36 $comments = $wpdb->get_results("SELECT comment_author, comment_author_url, comment_ID, comment_post_ID FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 5"); 
     36$comments = $wpdb->get_results("SELECT comment_author, comment_author_url, comment_ID, comment_post_ID FROM $wpdb->comments ,$wpdb->posts WHERE comment_post_ID = ID AND comment_approved = '1' AND " . get_private_posts_cap_sql('post') . " ORDER BY comment_date_gmt DESC LIMIT 5"); 
    3737$numcomments = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'"); 
    3838 
    3939if ( $comments || $numcomments ) :