+ /**
+ * Decrements the update counts throughout the various menus.
+ *
+ * This includes the toolbar, the "Updates" menu item and the menu items
+ * for plugins and themes.
+ *
+ * @since 3.9.0
+ *
+ * @param {string} type The type of item that was updated or deleted.
+ * Can be 'plugin', 'theme'.
+ */
+ wp.updates.decrementCount = function( type ) {
+ settings.totals.counts.total = Math.max( --settings.totals.counts.total, 0 );
+
+ if ( 'plugin' === type ) {
+ settings.totals.counts.plugins = Math.max( --settings.totals.counts.plugins, 0 );
+ } else if ( 'theme' === type ) {
+ settings.totals.counts.themes = Math.max( --settings.totals.counts.themes, 0 );
+ }
+
+ wp.updates.refreshCount( type );
+ };
+