Check that $_POST array index is set before comparing it in post_preview().
This prevents PHP notices in cases where a user with 'edit_others_posts' but without 'publish_posts' previews another user's posts. Props tyxla. Fixes #31760. Built from https://develop.svn.wordpress.org/trunk@31896 git-svn-id: http://core.svn.wordpress.org/trunk@31875 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -1667,7 +1667,7 @@ function post_preview() {
|
||||
} else {
|
||||
$is_autosave = true;
|
||||
|
||||
if ( 'auto-draft' == $_POST['post_status'] )
|
||||
if ( isset( $_POST['post_status'] ) && 'auto-draft' == $_POST['post_status'] )
|
||||
$_POST['post_status'] = 'draft';
|
||||
|
||||
$saved_post_id = wp_create_post_autosave( $post->ID );
|
||||
|
||||
Reference in New Issue
Block a user