WordPress.org

Make WordPress Core

Ticket #47070: 47070-option-1.diff

File 47070-option-1.diff, 2.0 KB (added by afragen, 9 months ago)

Patch for option-1 example

  • wp-admin/includes/update.php

    diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php
    index d4c1dd6a07..e2c90d460c 100644
    a b function find_core_auto_update() { 
    8686                return false;
    8787        }
    8888
    89         include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
     89        include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
    9090
    9191        $auto_update = false;
    92         $upgrader    = new WP_Automatic_Updater;
     92        $upgrader    = new WP_Automatic_Updater();
    9393        foreach ( $updates->updates as $update ) {
    9494                if ( 'autoupdate' != $update->response ) {
    9595                        continue;
    function core_update_footer( $msg = '' ) { 
    212212
    213213        $cur = get_preferred_from_update_core();
    214214        if ( ! is_object( $cur ) ) {
    215                 $cur = new stdClass;
     215                $cur = new stdClass();
    216216        }
    217217
    218218        if ( ! isset( $cur->current ) ) {
    function wp_theme_update_row( $theme_key, $theme ) { 
    654654 * @return false|void
    655655 */
    656656function maintenance_nag() {
    657         include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version
     657        include ABSPATH . WPINC . '/version.php'; // include an unmodified $wp_version
    658658        global $upgrading;
    659659        $nag = isset( $upgrading );
    660660        if ( ! $nag ) {
    function wp_recovery_mode_nag() { 
    841841                return;
    842842        }
    843843
     844        $url = wp_login_url();
     845        $url = add_query_arg( 'action', WP_Recovery_Mode::EXIT_ACTION, $url );
     846        $url = wp_nonce_url( $url, WP_Recovery_Mode::EXIT_ACTION );
     847
    844848        ?>
    845849        <div class="notice notice-info">
    846850                <p>
    847                         <?php esc_html_e( 'You are in recovery mode. This means there may be an error with a theme or plugin. To exit recovery mode, log out or use the Exit button.' ); ?>
     851                        <?php
     852                        /* translators: %s: Recovery Mode exit link */
     853                        printf(
     854                                wp_kses_post(
     855                                        __( 'You are in recovery mode. This means there may be an error with a theme or plugin. To exit recovery mode, log out or use the Exit button. <a href="%s">Exit Recovery Mode</a>' )
     856                                ),
     857                                $url
     858                        );
     859                        ?>
    848860                </p>
    849861        </div>
    850862        <?php