WordPress.org

Make WordPress Core

Ticket #24922: 24922.diff

File 24922.diff, 1.9 KB (added by kuliraj, 6 years ago)

Filter added

  • wp-admin/network/upgrade.php

     
    4747        case "upgrade":
    4848                $n = ( isset($_GET['n']) ) ? intval($_GET['n']) : 0;
    4949
    50                 if ( $n < 5 ) {
     50                $n_sites = intval( apply_filters( 'ms_upgrade_sites', 5 ) );
     51
     52                if ( $n < $n_sites ) {
    5153                        /**
    5254                         * @global string $wp_db_version
    5355                         */
     
    5557                        update_site_option( 'wpmu_upgrade_site', $wp_db_version );
    5658                }
    5759
    58                 $blogs = $wpdb->get_results( "SELECT blog_id FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' AND spam = '0' AND deleted = '0' AND archived = '0' ORDER BY registered DESC LIMIT {$n}, 5", ARRAY_A );
     60                $blogs = $wpdb->get_results( "SELECT blog_id FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' AND spam = '0' AND deleted = '0' AND archived = '0' ORDER BY registered DESC LIMIT {$n}, {$n_sites}", ARRAY_A );
    5961                if ( empty( $blogs ) ) {
    6062                        echo '<p>' . __( 'All done!' ) . '</p>';
    6163                        break;
     
    9799                        do_action( 'wpmu_upgrade_site', $details[ 'blog_id' ] );
    98100                }
    99101                echo "</ul>";
    100                 ?><p><?php _e( 'If your browser doesn&#8217;t start loading the next page automatically, click this link:' ); ?> <a class="button" href="upgrade.php?action=upgrade&amp;n=<?php echo ($n + 5) ?>"><?php _e("Next Sites"); ?></a></p>
     102                ?><p><?php _e( 'If your browser doesn&#8217;t start loading the next page automatically, click this link:' ); ?> <a class="button" href="upgrade.php?action=upgrade&amp;n=<?php echo ($n + $n_sites) ?>"><?php _e("Next Sites"); ?></a></p>
    101103                <script type="text/javascript">
    102104                <!--
    103105                function nextpage() {
    104                         location.href = "upgrade.php?action=upgrade&n=<?php echo ($n + 5) ?>";
     106                        location.href = "upgrade.php?action=upgrade&n=<?php echo ($n + $n_sites) ?>";
    105107                }
    106108                setTimeout( "nextpage()", 250 );
    107109                //-->