Changeset 7715
- Timestamp:
- 04/17/2008 12:10:20 AM (18 years ago)
- Location:
- branches/2.5
- Files:
-
- 2 edited
-
wp-admin/menu.php (modified) (1 diff)
-
wp-includes/comment.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/2.5/wp-admin/menu.php
r7619 r7715 21 21 $menu[10] = array(__('Manage'), 'edit_posts', 'edit.php'); 22 22 23 $awaiting_mod = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'"); 23 $awaiting_mod = wp_count_comments(); 24 $awaiting_mod = $awaiting_mod->moderated; 24 25 $menu[15] = array(__('Design'), 'switch_themes', 'themes.php'); 25 26 $menu[20] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='count-$awaiting_mod'><span class='comment-count'>$awaiting_mod</span></span>" ), 'edit_posts', 'edit-comments.php'); -
branches/2.5/wp-includes/comment.php
r7425 r7715 452 452 global $wpdb; 453 453 454 $count = wp_cache_get('comments', 'counts'); 455 456 if ( false !== $count ) 457 return $count; 458 454 459 $count = $wpdb->get_results( "SELECT comment_approved, COUNT( * ) AS num_comments FROM {$wpdb->comments} GROUP BY comment_approved", ARRAY_A ); 455 460 … … 465 470 } 466 471 467 return (object) $stats; 472 $stats = (object) $stats; 473 wp_cache_set('comments', $stats, 'counts'); 474 475 return $stats; 468 476 } 469 477
Note: See TracChangeset
for help on using the changeset viewer.