Move _show_post_preview() back next to _set_preview(). see #23539.
git-svn-id: http://core.svn.wordpress.org/trunk@23866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
fb868a2164
commit
48f5701214
|
@ -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).
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue