Move _show_post_preview() back next to _set_preview(). see #23539.

git-svn-id: https://develop.svn.wordpress.org/trunk@23866 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2013-03-29 16:31:33 +00:00
parent 07b28e52f7
commit 729396af3a

View File

@ -509,6 +509,18 @@ function _set_preview($post) {
return $post;
}
function _show_post_preview() {
if ( isset($_GET['preview_id']) && isset($_GET['preview_nonce']) ) {
$id = (int) $_GET['preview_id'];
if ( false == wp_verify_nonce( $_GET['preview_nonce'], 'post_preview_' . $id ) )
wp_die( __('You do not have permission to preview drafts.') );
add_filter('the_preview', '_set_preview');
}
}
/**
* Filters post meta retrieval to get values from the actual autosave post,
* and not its parent. Filters revisioned meta keys only.
@ -642,19 +654,6 @@ function _wp_upgrade_revisions_of_post( $post ) {
return true;
}
function _show_post_preview() {
if ( isset($_GET['preview_id']) && isset($_GET['preview_nonce']) ) {
$id = (int) $_GET['preview_id'];
if ( false == wp_verify_nonce( $_GET['preview_nonce'], 'post_preview_' . $id ) )
wp_die( __('You do not have permission to preview drafts.') );
add_filter('the_preview', '_set_preview');
}
}
/**
* Determines if the specified post's most recent revision matches the post (by checking post_modified).
*