diff --git a/wp-admin/menu.php b/wp-admin/menu.php index d04fd3c12f..64f80190cf 100644 --- a/wp-admin/menu.php +++ b/wp-admin/menu.php @@ -67,10 +67,21 @@ $menu[15] = array( __('Links'), 'manage_links', 'link-manager.php', '', 'menu-to // $menu[20] = Pages -$awaiting_mod = wp_count_comments(); -$awaiting_mod = $awaiting_mod->moderated; -$menu[25] = array( sprintf( __('Comments %s'), "" . number_format_i18n($awaiting_mod) . "" ), 'edit_posts', 'edit-comments.php', '', 'menu-top menu-icon-comments', 'menu-comments', 'dashicons-admin-comments' ); -unset($awaiting_mod); +// Avoid the comment count query for users who cannot edit_posts. +if ( current_user_can( 'edit_posts' ) ) { + $awaiting_mod = wp_count_comments(); + $awaiting_mod = $awaiting_mod->moderated; + $menu[25] = array( + sprintf( __( 'Comments %s' ), '' . number_format_i18n( $awaiting_mod ) . '' ), + 'edit_posts', + 'edit-comments.php', + '', + 'menu-top menu-icon-comments', + 'menu-comments', + 'dashicons-admin-comments', + ); + unset( $awaiting_mod ); +} $submenu[ 'edit-comments.php' ][0] = array( __('All Comments'), 'edit_posts', 'edit-comments.php' ); diff --git a/wp-includes/version.php b/wp-includes/version.php index a57ed79e0e..777bae2568 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-beta4-35690'; +$wp_version = '4.4-beta4-35691'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.