mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Preview fixes: different method of showing previews for published posts, now uses the proper templates. Fixes #8052
git-svn-id: https://develop.svn.wordpress.org/trunk@9509 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
+1
-11
@@ -223,17 +223,7 @@ case 'delete':
|
||||
case 'preview':
|
||||
check_admin_referer( 'autosave', 'autosavenonce' );
|
||||
|
||||
$id = post_preview();
|
||||
|
||||
if ( is_wp_error($id) )
|
||||
wp_die( $id->get_error_message() );
|
||||
|
||||
if ( $_POST['post_status'] == 'draft' ) {
|
||||
$url = get_option('home') . '/?p=' . $id . '&preview=true';
|
||||
} else {
|
||||
$nonce = wp_create_nonce('post_preview_' . $id);
|
||||
$url = get_option('home') . '/?wp_preview=' . $id . '&preview_nonce=' . $nonce;
|
||||
}
|
||||
$url = post_preview();
|
||||
|
||||
wp_redirect($url);
|
||||
exit();
|
||||
|
||||
Reference in New Issue
Block a user