Don't allow editing pages via post.php. Redirect to page.php
git-svn-id: http://svn.automattic.com/wordpress/trunk@4780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
517790d375
commit
d6287980ea
|
@ -44,6 +44,12 @@ case 'edit':
|
||||||
$editing = true;
|
$editing = true;
|
||||||
$page_ID = $post_ID = $p = (int) $_GET['post'];
|
$page_ID = $post_ID = $p = (int) $_GET['post'];
|
||||||
$post = get_post_to_edit($page_ID);
|
$post = get_post_to_edit($page_ID);
|
||||||
|
|
||||||
|
if ( 'post' == $post->post_type ) {
|
||||||
|
wp_redirect("post.php?action=edit&post=$post_ID");
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
if($post->post_status == 'draft') {
|
if($post->post_status == 'draft') {
|
||||||
wp_enqueue_script('prototype');
|
wp_enqueue_script('prototype');
|
||||||
wp_enqueue_script('autosave');
|
wp_enqueue_script('autosave');
|
||||||
|
|
|
@ -47,6 +47,12 @@ case 'edit':
|
||||||
$editing = true;
|
$editing = true;
|
||||||
$post_ID = $p = (int) $_GET['post'];
|
$post_ID = $p = (int) $_GET['post'];
|
||||||
$post = get_post($post_ID);
|
$post = get_post($post_ID);
|
||||||
|
|
||||||
|
if ( 'page' == $post->post_type ) {
|
||||||
|
wp_redirect("page.php?action=edit&post=$post_ID");
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
if($post->post_status == 'draft') {
|
if($post->post_status == 'draft') {
|
||||||
wp_enqueue_script('prototype');
|
wp_enqueue_script('prototype');
|
||||||
wp_enqueue_script('autosave');
|
wp_enqueue_script('autosave');
|
||||||
|
|
Loading…
Reference in New Issue