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 #13071. Built from https://develop.svn.wordpress.org/trunk@38827 git-svn-id: http://core.svn.wordpress.org/trunk@38770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -14,7 +14,7 @@ $submenu['index.php'][0] = array( __( 'Home' ), 'read', 'index.php' );
|
||||
|
||||
$update_data = wp_get_update_data();
|
||||
if ( $update_data['counts']['total'] ) {
|
||||
$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' );
|
||||
$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' );
|
||||
} else {
|
||||
$submenu['index.php'][10] = array( __( 'Updates' ), 'update_core', 'update-core.php' );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user