mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Avoid displaying a negative number of plugin updates in admin menu.
fixes #28073. Built from https://develop.svn.wordpress.org/trunk@28254 git-svn-id: http://core.svn.wordpress.org/trunk@28082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
997cbaa03c
commit
db4423c5cd
@ -32,7 +32,7 @@ window.wp = window.wp || {};
|
||||
$elem = $( '#menu-plugins' );
|
||||
pluginCount = $elem.find( '.plugin-count' ).eq(0).text();
|
||||
pluginCount = parseInt( pluginCount, 10 ) - 1;
|
||||
if ( count < 0 ) {
|
||||
if ( pluginCount < 0 ) {
|
||||
return;
|
||||
}
|
||||
$elem.find( '.plugin-count' ).text( pluginCount );
|
||||
|
2
wp-admin/js/updates.min.js
vendored
2
wp-admin/js/updates.min.js
vendored
@ -1 +1 @@
|
||||
window.wp=window.wp||{},function(a,b){b.updates={},b.updates.decrementCount=function(b){var c,d,e;if(e=a("#wp-admin-bar-updates .ab-label"),c=e.text(),c=parseInt(c,10)-1,!(0>c)&&(a("#wp-admin-bar-updates .ab-item").removeAttr("title"),e.text(c),e=a('a[href="update-core.php"] .update-plugins'),e.each(function(a,b){b.className=b.className.replace(/count-\d+/,"count-"+c)}),e.removeAttr("title"),e.find(".update-count").text(c),"plugin"===b)){if(e=a("#menu-plugins"),d=e.find(".plugin-count").eq(0).text(),d=parseInt(d,10)-1,0>c)return;e.find(".plugin-count").text(d),e.find(".update-plugins").each(function(a,b){b.className=b.className.replace(/count-\d+/,"count-"+d)})}},a(window).on("message",function(c){var d,e=c.originalEvent,f=document.location,g=f.protocol+"//"+f.hostname;e.origin===g&&(d=a.parseJSON(e.data),"undefined"!=typeof d.action&&"decrementUpdateCount"===d.action&&b.updates.decrementCount(d.upgradeType))})}(jQuery,window.wp);
|
||||
window.wp=window.wp||{},function(a,b){b.updates={},b.updates.decrementCount=function(b){var c,d,e;if(e=a("#wp-admin-bar-updates .ab-label"),c=e.text(),c=parseInt(c,10)-1,!(0>c)&&(a("#wp-admin-bar-updates .ab-item").removeAttr("title"),e.text(c),e=a('a[href="update-core.php"] .update-plugins'),e.each(function(a,b){b.className=b.className.replace(/count-\d+/,"count-"+c)}),e.removeAttr("title"),e.find(".update-count").text(c),"plugin"===b)){if(e=a("#menu-plugins"),d=e.find(".plugin-count").eq(0).text(),d=parseInt(d,10)-1,0>d)return;e.find(".plugin-count").text(d),e.find(".update-plugins").each(function(a,b){b.className=b.className.replace(/count-\d+/,"count-"+d)})}},a(window).on("message",function(c){var d,e=c.originalEvent,f=document.location,g=f.protocol+"//"+f.hostname;e.origin===g&&(d=a.parseJSON(e.data),"undefined"!=typeof d.action&&"decrementUpdateCount"===d.action&&b.updates.decrementCount(d.upgradeType))})}(jQuery,window.wp);
|
Loading…
Reference in New Issue
Block a user