WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/19/2016 10:26:31 AM (3 years ago)
Author:
swissspidy
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/network/menu.php

    r37365 r38827  
    1515$update_data = wp_get_update_data();
    1616if ( $update_data['counts']['total'] ) {
    17     $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' );
     17    $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' );
    1818} else {
    1919    $submenu['index.php'][10] = array( __( 'Updates' ), 'update_core', 'update-core.php' );
Note: See TracChangeset for help on using the changeset viewer.