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:
Pascal Birchler
2016-10-19 10:27:29 +00:00
parent deda5d9796
commit e4d7dd2b8a
10 changed files with 118 additions and 64 deletions

View File

@@ -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' );
}