Show warning if user is logged out while writing or editing, includes patch by tott, fixes #7630
git-svn-id: http://svn.automattic.com/wordpress/trunk@9216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bda278846f
commit
72577aacd8
@ -17,9 +17,26 @@ define('WP_ADMIN', true);
|
|||||||
require_once('../wp-load.php');
|
require_once('../wp-load.php');
|
||||||
require_once('includes/admin.php');
|
require_once('includes/admin.php');
|
||||||
|
|
||||||
if ( !is_user_logged_in() )
|
if ( ! is_user_logged_in() ) {
|
||||||
|
|
||||||
|
if ( $_POST['action'] == 'autosave' ) {
|
||||||
|
$id = isset($_POST['post_ID'])? (int) $_POST['post_ID'] : 0;
|
||||||
|
|
||||||
|
if ( ! $id )
|
||||||
die('-1');
|
die('-1');
|
||||||
|
|
||||||
|
$message = sprintf( __('<strong>ALERT: You are logged out!</strong> Could not save draft. <a href="%s" target="blank">Please log in again.</a>'), wp_login_url() );
|
||||||
|
$x = new WP_Ajax_Response( array(
|
||||||
|
'what' => 'autosave',
|
||||||
|
'id' => $id,
|
||||||
|
'data' => $message
|
||||||
|
) );
|
||||||
|
$x->send();
|
||||||
|
}
|
||||||
|
|
||||||
|
die('-1');
|
||||||
|
}
|
||||||
|
|
||||||
if ( isset($_GET['action']) && 'ajax-tag-search' == $_GET['action'] ) {
|
if ( isset($_GET['action']) && 'ajax-tag-search' == $_GET['action'] ) {
|
||||||
if ( !current_user_can( 'manage_categories' ) )
|
if ( !current_user_can( 'manage_categories' ) )
|
||||||
die('-1');
|
die('-1');
|
||||||
|
Loading…
Reference in New Issue
Block a user