WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/16/2011 02:37:44 AM (10 years ago)
Author:
azaozz
Message:

Fix two rare regressions: alert when the login has expires and when post is edited by another user, fixes #16928

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r17354 r17640  
    917917    $do_lock = true;
    918918
    919     $data = '';
     919    $data = $alert = '';
    920920    /* translators: draft saved date format, see http://php.net/date */
    921921    $draft_saved_date_format = __('g:i:s a');
     
    925925    $supplemental = array();
    926926    if ( isset($login_grace_period) )
    927         $supplemental['session_expired'] = add_query_arg( 'interim-login', 1, wp_login_url() );
     927        $alert .= sprintf( __('Your login has expired. Please open a new browser window and <a href="%s" target="_blank">login again</a>. '), add_query_arg( 'interim-login', 1, wp_login_url() ) );
    928928
    929929    $id = $revision_id = 0;
     
    940940        $last_user = get_userdata( $last );
    941941        $last_user_name = $last_user ? $last_user->display_name : __( 'Someone' );
    942         $data = new WP_Error( 'locked', sprintf(
    943             $_POST['post_type'] == 'page' ? __( 'Autosave disabled: %s is currently editing this page.' ) : __( 'Autosave disabled: %s is currently editing this post.' ),
    944             esc_html( $last_user_name )
    945         ) );
     942        $data = __( 'Autosave disabled.' );
    946943
    947944        $supplemental['disable_autosave'] = 'disable';
     945        $alert .= sprintf( __( '%s is currently editing this article. If you update it, you will overwrite the changes.' ), esc_html( $last_user_name ) );
    948946    }
    949947
     
    990988        }
    991989    }
     990
     991    if ( ! empty($alert) )
     992        $supplemental['alert'] = $alert;
    992993
    993994    $x = new WP_Ajax_Response( array(
Note: See TracChangeset for help on using the changeset viewer.