In wp.updates.decrementCount(), only display the count if it's a valid non-negative integer.
props jdgrimes. fixes #29527. git-svn-id: https://develop.svn.wordpress.org/trunk@29960 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d7955317f3
commit
0caa0b1dbf
@ -15,7 +15,7 @@ window.wp = window.wp || {};
|
||||
$elem = $( '#wp-admin-bar-updates .ab-label' );
|
||||
count = $elem.text();
|
||||
count = parseInt( count, 10 ) - 1;
|
||||
if ( count < 0 ) {
|
||||
if ( count < 0 || isNaN( count ) ) {
|
||||
return;
|
||||
}
|
||||
$( '#wp-admin-bar-updates .ab-item' ).removeAttr( 'title' );
|
||||
@ -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 ( pluginCount < 0 ) {
|
||||
if ( pluginCount < 0 || isNaN( pluginCount ) ) {
|
||||
return;
|
||||
}
|
||||
$elem.find( '.plugin-count' ).text( pluginCount );
|
||||
|
Loading…
Reference in New Issue
Block a user