Changeset 35691
- Timestamp:
- 11/18/2015 09:33:03 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/menu.php
r35590 r35691 68 68 // $menu[20] = Pages 69 69 70 $awaiting_mod = wp_count_comments(); 71 $awaiting_mod = $awaiting_mod->moderated; 72 $menu[25] = array( sprintf( __('Comments %s'), "<span class='awaiting-mod count-$awaiting_mod'><span class='pending-count'>" . number_format_i18n($awaiting_mod) . "</span></span>" ), 'edit_posts', 'edit-comments.php', '', 'menu-top menu-icon-comments', 'menu-comments', 'dashicons-admin-comments' ); 73 unset($awaiting_mod); 70 // Avoid the comment count query for users who cannot edit_posts. 71 if ( current_user_can( 'edit_posts' ) ) { 72 $awaiting_mod = wp_count_comments(); 73 $awaiting_mod = $awaiting_mod->moderated; 74 $menu[25] = array( 75 sprintf( __( 'Comments %s' ), '<span class="awaiting-mod count-' . absint( $awaiting_mod ) . '"><span class="pending-count">' . number_format_i18n( $awaiting_mod ) . '</span></span>' ), 76 'edit_posts', 77 'edit-comments.php', 78 '', 79 'menu-top menu-icon-comments', 80 'menu-comments', 81 'dashicons-admin-comments', 82 ); 83 unset( $awaiting_mod ); 84 } 74 85 75 86 $submenu[ 'edit-comments.php' ][0] = array( __('All Comments'), 'edit_posts', 'edit-comments.php' );
Note: See TracChangeset
for help on using the changeset viewer.