Changeset 10079
- Timestamp:
- 12/05/2008 11:42:06 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/dashboard.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/dashboard.php
r10076 r10079 397 397 */ 398 398 function wp_dashboard_recent_comments() { 399 $status = ( current_user_can('edit_posts') ) ? '' : 'approved'; 400 401 list($comments, $total) = _wp_get_comment_list( $status, false, 0, 5 ); 399 global $wpdb; 400 401 if ( current_user_can('edit_posts') ) 402 $allowed_states = array('0', '1'); 403 else 404 $allowed_states = array('1'); 405 406 // Select all comment types and filter out spam later for better query performance. 407 $comments = $wpdb->get_results( "SELECT * FROM $wpdb->comments ORDER BY comment_date_gmt DESC LIMIT 0, 50" ); 402 408 403 409 if ( $comments ) : … … 406 412 <div id="the-comment-list" class="list:comment"> 407 413 <?php 408 foreach ( $comments as $comment ) 409 _wp_dashboard_recent_comments_row( $comment ); 414 foreach ( $comments as $comment ) { 415 if ( in_array($comment->comment_approved, $allowed_states) ) 416 _wp_dashboard_recent_comments_row( $comment ); 417 } 410 418 ?> 411 419
Note: See TracChangeset
for help on using the changeset viewer.