Make WordPress Core


Ignore:
Timestamp:
10/19/2016 10:26:31 AM (10 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/update-core.php

    r38743 r38827  
    619619        do_action( 'core_upgrade_preamble' );
    620620        echo '</div>';
     621
     622        wp_localize_script( 'updates', '_wpUpdatesItemCounts', array(
     623                'totals'  => wp_get_update_data(),
     624        ) );
     625
    621626        include(ABSPATH . 'wp-admin/admin-footer.php');
    622627
     
    642647        if ( isset( $_POST['upgrade'] ) )
    643648                do_core_upgrade($reinstall);
     649
     650        wp_localize_script( 'updates', '_wpUpdatesItemCounts', array(
     651                'totals'  => wp_get_update_data(),
     652        ) );
    644653
    645654        include(ABSPATH . 'wp-admin/admin-footer.php');
     
    671680        echo '<iframe src="', $url, '" style="width: 100%; height: 100%; min-height: 750px;" frameborder="0" title="' . esc_attr__( 'Update progress' ) . '"></iframe>';
    672681        echo '</div>';
     682
     683        wp_localize_script( 'updates', '_wpUpdatesItemCounts', array(
     684                'totals'  => wp_get_update_data(),
     685        ) );
     686
    673687        include(ABSPATH . 'wp-admin/admin-footer.php');
    674688
     
    701715        </div>
    702716        <?php
     717
     718        wp_localize_script( 'updates', '_wpUpdatesItemCounts', array(
     719                'totals'  => wp_get_update_data(),
     720        ) );
     721
    703722        include(ABSPATH . 'wp-admin/admin-footer.php');
    704723
     
    720739        $upgrader = new Language_Pack_Upgrader( new Language_Pack_Upgrader_Skin( compact( 'url', 'nonce', 'title', 'context' ) ) );
    721740        $result = $upgrader->bulk_upgrade();
     741
     742        wp_localize_script( 'updates', '_wpUpdatesItemCounts', array(
     743                'totals'  => wp_get_update_data(),
     744        ) );
    722745
    723746        require_once( ABSPATH . 'wp-admin/admin-footer.php' );
Note: See TracChangeset for help on using the changeset viewer.