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:
Ryan Boren 2007-08-15 22:31:19 +00:00
parent b5665344c2
commit 9ef753c3c5
2 changed files with 4 additions and 0 deletions

View File

@ -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();

View File

@ -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();