Make WordPress Core

Ticket #48937: 48937.patch

File 48937.patch, 2.3 KB (added by jdamner, 14 months ago)

new patch with <progress> indicator and new wording

  • src/wp-includes/functions.php

    diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php
    index 01f28bd08f..6097bc2036 100644
    a b function wp_die( $message = '', $title = '', $args = array() ) { 
    37253725 * @param string|WP_Error $message Error message or WP_Error object.
    37263726 * @param string          $title   Optional. Error title. Default empty.
    37273727 * @param string|array    $args    Optional. Arguments to control behavior. Default empty array.
     3728 *
     3729 * @global int|false $upgrading The upgrade time from `.maintenance` file.
    37283730 */
    37293731function _default_wp_die_handler( $message, $title = '', $args = array() ) {
    37303732        list( $message, $title, $parsed_args ) = _wp_die_process_input( $message, $title, $args );
    function _default_wp_die_handler( $message, $title = '', $args = array() ) { 
    38983900                        box-shadow: none;
    38993901                }
    39003902
     3903                progress {
     3904                        width: 100%;
     3905                }
     3906
    39013907                <?php
    39023908                if ( 'rtl' === $text_direction ) {
    39033909                        echo 'body { font-family: Tahoma, Arial; }';
    function _default_wp_die_handler( $message, $title = '', $args = array() ) { 
    39083914<body id="error-page">
    39093915<?php endif; // ! did_action( 'admin_head' ) ?>
    39103916        <?php echo $message; ?>
     3917
     3918        <?php
     3919        /**
     3920         * Filters the default value of the maintenance page refresh interval.
     3921         *
     3922         * In browsers that support Javascript, the maintenance page will be automatically refreshed
     3923         * with this interval. If set to 0, the page will not be refreshed.
     3924         *
     3925         * @since Unkown
     3926         *
     3927         * @param int  $period The refresh interval in seconds (defaults 10).
     3928         */
     3929        $refresh_period = apply_filters( 'wp_maintenance_mode_refresh_period', 10 );
     3930        $refresh_period = absint( $refresh_period );
     3931
     3932        $refresh_text = __( 'The page will automatically refresh when maintenance is over.' );
     3933
     3934        global $upgrading;
     3935        if ( ! empty( $upgrading ) && $refresh_period ) : ?>
     3936
     3937                <div id="progress" style='display: none;'>
     3938                        <progress indeterminate></progress>
     3939                        <p><?php echo $refresh_text; ?></p>
     3940                </div>
     3941
     3942                <script>
     3943                        document.getElementById('progress').style.display = 'block';
     3944                        const period = <?php echo $refresh_period; ?>;
     3945                        setTimeout(function() {
     3946                                window.location.reload(true);
     3947                        }, period * 1000);
     3948                </script>
     3949
     3950        <?php endif; ?>
    39113951</body>
    39123952</html>
    39133953        <?php