mirror of
git://develop.git.wordpress.org/
synced 2025-02-24 08:33:35 +01:00
Display error message when attempting to edit post or page IDs that do not exist. Props Viper007Bond. fixes #4737
git-svn-id: https://develop.svn.wordpress.org/trunk@5875 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b5665344c2
commit
9ef753c3c5
@ -45,6 +45,8 @@ case 'edit':
|
||||
$page_ID = $post_ID = $p = (int) $_GET['post'];
|
||||
$post = get_post_to_edit($page_ID);
|
||||
|
||||
if ( empty($post->ID) ) wp_die( __("You attempted to edit a page that doesn't exist. Perhaps it was deleted?") );
|
||||
|
||||
if ( 'post' == $post->post_type ) {
|
||||
wp_redirect("post.php?action=edit&post=$post_ID");
|
||||
exit();
|
||||
|
@ -48,6 +48,8 @@ case 'edit':
|
||||
$post_ID = $p = (int) $_GET['post'];
|
||||
$post = get_post($post_ID);
|
||||
|
||||
if ( empty($post->ID) ) wp_die( __("You attempted to edit a post that doesn't exist. Perhaps it was deleted?") );
|
||||
|
||||
if ( 'page' == $post->post_type ) {
|
||||
wp_redirect("page.php?action=edit&post=$post_ID");
|
||||
exit();
|
||||
|
Loading…
x
Reference in New Issue
Block a user