<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[38827] trunk/src: Upgrade/Install: Refresh update counts after page load.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/38827">38827</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/38827","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>swissspidy</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2016-10-19 10:26:31 +0000 (Wed, 19 Oct 2016)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Upgrade/Install: Refresh update counts after page load.
By enqueuing the updates script in the footer and passing the number of available updates to it after page load, the update bubbles will be more accurate.
Props ocean90, swissspidy.
Fixes <a href="https://core.trac.wordpress.org/ticket/13071">#13071</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesclasswpmsthemeslisttablephp">trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswppluginslisttablephp">trunk/src/wp-admin/includes/class-wp-plugins-list-table.php</a></li>
<li><a href="#trunksrcwpadminjsupdatesjs">trunk/src/wp-admin/js/updates.js</a></li>
<li><a href="#trunksrcwpadminmenuphp">trunk/src/wp-admin/menu.php</a></li>
<li><a href="#trunksrcwpadminnetworkmenuphp">trunk/src/wp-admin/network/menu.php</a></li>
<li><a href="#trunksrcwpadminthemesphp">trunk/src/wp-admin/themes.php</a></li>
<li><a href="#trunksrcwpadminupdatecorephp">trunk/src/wp-admin/update-core.php</a></li>
<li><a href="#trunksrcwpincludesscriptloaderphp">trunk/src/wp-includes/script-loader.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesclasswpmsthemeslisttablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php 2016-10-19 09:28:22 UTC (rev 38826)
+++ trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php 2016-10-19 10:26:31 UTC (rev 38827)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -150,7 +150,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $total_this_page = $totals[ $status ];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_localize_script( 'updates', '_wpUpdatesItemCounts', array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'totals' => $totals,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'themes' => $totals,
+ 'totals' => wp_get_update_data(),
</ins><span class="cx" style="display: block; padding: 0 10px"> ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $orderby ) {
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswppluginslisttablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-plugins-list-table.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-plugins-list-table.php 2016-10-19 09:28:22 UTC (rev 38826)
+++ trunk/src/wp-admin/includes/class-wp-plugins-list-table.php 2016-10-19 10:26:31 UTC (rev 38827)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -253,6 +253,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_localize_script( 'updates', '_wpUpdatesItemCounts', array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'plugins' => $js_plugins,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'totals' => wp_get_update_data(),
</ins><span class="cx" style="display: block; padding: 0 10px"> ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $orderby ) {
</span></span></pre></div>
<a id="trunksrcwpadminjsupdatesjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/js/updates.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/updates.js 2016-10-19 09:28:22 UTC (rev 38826)
+++ trunk/src/wp-admin/js/updates.js 2016-10-19 10:26:31 UTC (rev 38827)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,10 +21,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param {Array} settings.plugins.inactive Base names of inactive plugins.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param {Array} settings.plugins.upgrade Base names of plugins with updates available.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param {Array} settings.plugins.recently_activated Base names of recently activated plugins.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param {object=} settings.totals Plugin/theme status information or null.
- * @param {number} settings.totals.all Amount of all plugins or themes.
- * @param {number} settings.totals.upgrade Amount of plugins or themes with updates available.
- * @param {number} settings.totals.disabled Amount of disabled themes.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param {object=} settings.themes Plugin/theme status information or null.
+ * @param {number} settings.themes.all Amount of all themes.
+ * @param {number} settings.themes.upgrade Amount of themes with updates available.
+ * @param {number} settings.themes.disabled Amount of disabled themes.
+ * @param {object=} settings.totals Combined information for available update counts.
+ * @param {number} settings.totals.count Holds the amount of available updates.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> (function( $, wp, settings ) {
</span><span class="cx" style="display: block; padding: 0 10px"> var $document = $( document );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -261,76 +263,93 @@
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Decrements the update counts throughout the various menus.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Refreshes update counts everywhere on the screen.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * 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'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.7.0
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp.updates.decrementCount = function( type ) {
- var $adminBarUpdates = $( '#wp-admin-bar-updates' ),
- $dashboardNavMenuUpdateCount = $( 'a[href="update-core.php"] .update-plugins' ),
- count = $adminBarUpdates.find( '.ab-label' ).text(),
- $menuItem, $itemCount, itemCount;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp.updates.refreshCount = function() {
+ var $adminBarUpdates = $( '#wp-admin-bar-updates' ),
+ $dashboardNavMenuUpdateCount = $( 'a[href="update-core.php"] .update-plugins' ),
+ $pluginsNavMenuUpdateCount = $( 'a[href="plugins.php"] .update-plugins' ),
+ $appearanceNavMenuUpdateCount = $( 'a[href="themes.php"] .update-plugins' ),
+ itemCount;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- count = parseInt( count, 10 ) - 1;
-
- if ( count < 0 || isNaN( count ) ) {
- return;
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $adminBarUpdates.find( '.ab-item' ).removeAttr( 'title' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $adminBarUpdates.find( '.ab-label' ).text( count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $adminBarUpdates.find( '.ab-label' ).text( settings.totals.counts.total );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Remove the update count from the toolbar if it's zero.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! count ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 0 === settings.totals.counts.total ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $adminBarUpdates.find( '.ab-label' ).parents( 'li' ).remove();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Update the "Updates" menu item.
</span><span class="cx" style="display: block; padding: 0 10px"> $dashboardNavMenuUpdateCount.each( function( index, element ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- element.className = element.className.replace( /count-\d+/, 'count-' + count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ element.className = element.className.replace( /count-\d+/, 'count-' + settings.totals.counts.total );
</ins><span class="cx" style="display: block; padding: 0 10px"> } );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( settings.totals.counts.total > 0 ) {
+ $dashboardNavMenuUpdateCount.find( '.update-count' ).text( settings.totals.counts.total );
+ } else {
+ $dashboardNavMenuUpdateCount.remove();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $dashboardNavMenuUpdateCount.removeAttr( 'title' );
- $dashboardNavMenuUpdateCount.find( '.update-count' ).text( count );
-
- if ( 'plugin' === type ) {
- $menuItem = $( '#menu-plugins' );
- $itemCount = $menuItem.find( '.plugin-count' );
- } else if ( 'theme' === type ) {
- $menuItem = $( '#menu-appearance' );
- $itemCount = $menuItem.find( '.theme-count' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Update the "Plugins" menu item.
+ $pluginsNavMenuUpdateCount.each( function( index, element ) {
+ element.className = element.className.replace( /count-\d+/, 'count-' + settings.totals.counts.plugins );
+ } );
+ if ( settings.totals.counts.total > 0 ) {
+ $pluginsNavMenuUpdateCount.find( '.plugin-count' ).text( settings.totals.counts.plugins );
+ } else {
+ $pluginsNavMenuUpdateCount.remove();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Decrement the counter of the other menu items.
- if ( $itemCount ) {
- itemCount = $itemCount.eq( 0 ).text();
- itemCount = parseInt( itemCount, 10 ) - 1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Update the "Appearance" menu item.
+ $appearanceNavMenuUpdateCount.each( function( index, element ) {
+ element.className = element.className.replace( /count-\d+/, 'count-' + settings.totals.counts.themes );
+ } );
+ if ( settings.totals.counts.total > 0 ) {
+ $appearanceNavMenuUpdateCount.find( '.theme-count' ).text( settings.totals.counts.themes );
+ } else {
+ $appearanceNavMenuUpdateCount.remove();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( itemCount < 0 || isNaN( itemCount ) ) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Update list table filter navigation.
+ if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) {
+ itemCount = settings.totals.counts.plugins;
+ } else if ( 'themes' === pagenow || 'themes-network' === pagenow ) {
+ itemCount = settings.totals.counts.themes;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( itemCount > 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $( '.subsubsub .upgrade .count' ).text( '(' + itemCount + ')' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- $itemCount.text( itemCount );
- $menuItem.find( '.update-plugins' ).each( function( index, element ) {
- element.className = element.className.replace( /count-\d+/, 'count-' + itemCount );
- } );
</del><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $( '.subsubsub .upgrade' ).remove();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $menuItem.find( '.update-plugins' ).remove();
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * 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 );
+ };
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Sends an Ajax request to the server to update a plugin.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1251,7 +1270,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $themeRows.css( { backgroundColor: '#faafaa' } ).fadeOut( 350, function() {
</span><span class="cx" style="display: block; padding: 0 10px"> var $views = $( '.subsubsub' ),
</span><span class="cx" style="display: block; padding: 0 10px"> $themeRow = $( this ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- totals = settings.totals,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ totals = settings.themes,
</ins><span class="cx" style="display: block; padding: 0 10px"> deletedRow = wp.template( 'item-deleted-row' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $themeRow.hasClass( 'plugin-update-tr' ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1689,6 +1708,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $pluginSearch = $( '.plugins-php .wp-filter-search' ),
</span><span class="cx" style="display: block; padding: 0 10px"> $pluginInstallSearch = $( '.plugin-install-php .wp-filter-search' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ settings = _.extend( settings, window._wpUpdatesItemCounts || {} );
+
+ if ( settings.totals ) {
+ wp.updates.refreshCount();
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="cx" style="display: block; padding: 0 10px"> * Whether a user needs to submit filesystem credentials.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2412,4 +2437,4 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $( window ).on( 'beforeunload', wp.updates.beforeunload );
</span><span class="cx" style="display: block; padding: 0 10px"> } );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-})( jQuery, window.wp, _.extend( window._wpUpdatesSettings, window._wpUpdatesItemCounts || {} ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+})( jQuery, window.wp, window._wpUpdatesSettings );
</ins></span></pre></div>
<a id="trunksrcwpadminmenuphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/menu.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/menu.php 2016-10-19 09:28:22 UTC (rev 38826)
+++ trunk/src/wp-admin/menu.php 2016-10-19 10:26:31 UTC (rev 38827)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -38,7 +38,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $cap = 'update_plugins';
</span><span class="cx" style="display: block; padding: 0 10px"> else
</span><span class="cx" style="display: block; padding: 0 10px"> $cap = 'update_themes';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $submenu[ 'index.php' ][10] = array( sprintf( __('Updates %s'), "<span class='update-plugins count-{$update_data['counts']['total']}' title='{$update_data['title']}'><span class='update-count'>" . number_format_i18n($update_data['counts']['total']) . "</span></span>" ), $cap, 'update-core.php');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $submenu[ 'index.php' ][10] = array( sprintf( __('Updates %s'), "<span class='update-plugins count-{$update_data['counts']['total']}'><span class='update-count'>" . number_format_i18n($update_data['counts']['total']) . "</span></span>" ), $cap, 'update-core.php');
</ins><span class="cx" style="display: block; padding: 0 10px"> unset( $cap );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpadminnetworkmenuphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/network/menu.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/network/menu.php 2016-10-19 09:28:22 UTC (rev 38826)
+++ trunk/src/wp-admin/network/menu.php 2016-10-19 10:26:31 UTC (rev 38827)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,7 +14,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $update_data = wp_get_update_data();
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $update_data['counts']['total'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $submenu['index.php'][10] = array( sprintf( __( 'Updates %s' ), "<span class='update-plugins count-{$update_data['counts']['total']}' title='{$update_data['title']}'><span class='update-count'>" . number_format_i18n( $update_data['counts']['total'] ) . "</span></span>" ), 'update_core', 'update-core.php' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $submenu['index.php'][10] = array( sprintf( __( 'Updates %s' ), "<span class='update-plugins count-{$update_data['counts']['total']}'><span class='update-count'>" . number_format_i18n( $update_data['counts']['total'] ) . "</span></span>" ), 'update_core', 'update-core.php' );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $submenu['index.php'][10] = array( __( 'Updates' ), 'update_core', 'update-core.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminthemesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/themes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/themes.php 2016-10-19 09:28:22 UTC (rev 38826)
+++ trunk/src/wp-admin/themes.php 2016-10-19 10:26:31 UTC (rev 38827)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -490,4 +490,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_print_admin_notice_templates();
</span><span class="cx" style="display: block; padding: 0 10px"> wp_print_update_row_templates();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+wp_localize_script( 'updates', '_wpUpdatesItemCounts', array(
+ 'totals' => wp_get_update_data(),
+) );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> require( ABSPATH . 'wp-admin/admin-footer.php' );
</span></span></pre></div>
<a id="trunksrcwpadminupdatecorephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/update-core.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/update-core.php 2016-10-19 09:28:22 UTC (rev 38826)
+++ trunk/src/wp-admin/update-core.php 2016-10-19 10:26:31 UTC (rev 38827)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -618,6 +618,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'core_upgrade_preamble' );
</span><span class="cx" style="display: block; padding: 0 10px"> echo '</div>';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ wp_localize_script( 'updates', '_wpUpdatesItemCounts', array(
+ 'totals' => wp_get_update_data(),
+ ) );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> include(ABSPATH . 'wp-admin/admin-footer.php');
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -642,6 +647,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $_POST['upgrade'] ) )
</span><span class="cx" style="display: block; padding: 0 10px"> do_core_upgrade($reinstall);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_localize_script( 'updates', '_wpUpdatesItemCounts', array(
+ 'totals' => wp_get_update_data(),
+ ) );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> include(ABSPATH . 'wp-admin/admin-footer.php');
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( 'do-plugin-upgrade' == $action ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -670,6 +679,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> echo '<h1>' . __( 'Update Plugins' ) . '</h1>';
</span><span class="cx" style="display: block; padding: 0 10px"> echo '<iframe src="', $url, '" style="width: 100%; height: 100%; min-height: 750px;" frameborder="0" title="' . esc_attr__( 'Update progress' ) . '"></iframe>';
</span><span class="cx" style="display: block; padding: 0 10px"> echo '</div>';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ wp_localize_script( 'updates', '_wpUpdatesItemCounts', array(
+ 'totals' => wp_get_update_data(),
+ ) );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> include(ABSPATH . 'wp-admin/admin-footer.php');
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( 'do-theme-upgrade' == $action ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -700,6 +714,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <iframe src="<?php echo $url ?>" style="width: 100%; height: 100%; min-height: 750px;" frameborder="0" title="<?php esc_attr_e( 'Update progress' ); ?>"></iframe>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ wp_localize_script( 'updates', '_wpUpdatesItemCounts', array(
+ 'totals' => wp_get_update_data(),
+ ) );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> include(ABSPATH . 'wp-admin/admin-footer.php');
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( 'do-translation-upgrade' == $action ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -720,6 +739,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $upgrader = new Language_Pack_Upgrader( new Language_Pack_Upgrader_Skin( compact( 'url', 'nonce', 'title', 'context' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $upgrader->bulk_upgrade();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_localize_script( 'updates', '_wpUpdatesItemCounts', array(
+ 'totals' => wp_get_update_data(),
+ ) );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . 'wp-admin/admin-footer.php' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span></span></pre></div>
<a id="trunksrcwpincludesscriptloaderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/script-loader.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/script-loader.php 2016-10-19 09:28:22 UTC (rev 38826)
+++ trunk/src/wp-includes/script-loader.php 2016-10-19 10:26:31 UTC (rev 38827)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -611,7 +611,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'ays' => __('Are you sure you want to install this plugin?')
</span><span class="cx" style="display: block; padding: 0 10px"> ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $scripts->add( 'updates', "/wp-admin/js/updates$suffix.js", array( 'jquery', 'wp-util', 'wp-a11y' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $scripts->add( 'updates', "/wp-admin/js/updates$suffix.js", array( 'jquery', 'wp-util', 'wp-a11y' ), false, 1 );
</ins><span class="cx" style="display: block; padding: 0 10px"> did_action( 'init' ) && $scripts->localize( 'updates', '_wpUpdatesSettings', array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'ajax_nonce' => wp_create_nonce( 'updates' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'l10n' => array(
</span></span></pre>
</div>
</div>
</body>
</html>