Commit eb3e9e6d authored by ryan's avatar ryan

Display error message when attempting to edit post or page IDs that do not...

Display error message when attempting to edit post or page IDs that do not exist.  Props Viper007Bond. fixes #4737

git-svn-id: http://svn.automattic.com/wordpress/trunk@5875 1a063a9b-81f0-0310-95a4-ce76da25c4cd
parent 4ab52670
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment