diff --git wp-admin/admin.php wp-admin/admin.php
index ce7edfb..0449c0b 100644
|
|
|
if ( isset($_GET['page']) ) { |
| 88 | 88 | $plugin_page = plugin_basename($plugin_page); |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | | if ( isset($_GET['post_type']) ) |
| | 91 | if ( isset($_REQUEST['post_type']) ) |
| 92 | 92 | $typenow = sanitize_key($_GET['post_type']); |
| 93 | 93 | else |
| 94 | 94 | $typenow = ''; |
diff --git wp-admin/includes/template.php wp-admin/includes/template.php
index a788b8f..c96b43c 100644
|
|
|
function set_current_screen( $id = '' ) { |
| 2077 | 2077 | $current_screen->id .= '-' . $typenow; |
| 2078 | 2078 | $current_screen->post_type = $typenow; |
| 2079 | 2079 | } elseif ( 'post' == $current_screen->id ) { |
| 2080 | | if ( empty($typenow) ) |
| | 2080 | if ( isset($_GET['post']) ) |
| | 2081 | $post_id = (int) $_GET['post']; |
| | 2082 | elseif ( isset($_POST['post_ID']) ) |
| | 2083 | $post_id = (int) $_POST['post_ID']; |
| | 2084 | else |
| | 2085 | $post_id = 0; |
| | 2086 | |
| | 2087 | $GLOBALS['post_id'] = $post_id; |
| | 2088 | |
| | 2089 | $post_type_object = null; |
| | 2090 | |
| | 2091 | if ( $post_id ) { |
| | 2092 | $post = get_post( $post_id ); |
| | 2093 | $typenow = $post->post_type; |
| | 2094 | } |
| | 2095 | |
| | 2096 | if ( empty( $typenow ) || ! get_post_type_object( $typenow ) ) |
| 2081 | 2097 | $typenow = 'post'; |
| 2082 | | $current_screen->id = $typenow; |
| 2083 | | $current_screen->post_type = $typenow; |
| | 2098 | |
| | 2099 | $current_screen->id = $current_screen->post_type = $typenow; |
| 2084 | 2100 | } elseif ( 'edit-tags' == $current_screen->id ) { |
| 2085 | 2101 | if ( empty($taxnow) ) |
| 2086 | 2102 | $taxnow = 'post_tag'; |
| | 2103 | if ( empty( $typenow ) ) |
| | 2104 | $typenow = 'post'; |
| 2087 | 2105 | $current_screen->id = 'edit-' . $taxnow; |
| 2088 | 2106 | $current_screen->taxonomy = $taxnow; |
| 2089 | 2107 | } |
diff --git wp-admin/post.php wp-admin/post.php
index 0dae46d..19e3272 100644
|
|
|
$submenu_file = 'edit.php'; |
| 16 | 16 | |
| 17 | 17 | wp_reset_vars(array('action', 'safe_mode', 'withcomments', 'posts', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder')); |
| 18 | 18 | |
| 19 | | if ( isset($_GET['post']) ) |
| 20 | | $post_id = (int) $_GET['post']; |
| 21 | | elseif ( isset($_POST['post_ID']) ) |
| 22 | | $post_id = (int) $_POST['post_ID']; |
| 23 | | else |
| 24 | | $post_id = 0; |
| 25 | 19 | $post_ID = $post_id; |
| 26 | | $post = null; |
| 27 | | $post_type_object = null; |
| 28 | | $post_type = null; |
| 29 | | if ( $post_id ) { |
| 30 | | $post = get_post($post_id); |
| 31 | | if ( $post ) { |
| 32 | | $post_type_object = get_post_type_object($post->post_type); |
| 33 | | if ( $post_type_object ) { |
| 34 | | $post_type = $post->post_type; |
| 35 | | $current_screen->post_type = $post->post_type; |
| 36 | | $current_screen->id = $current_screen->post_type; |
| 37 | | } |
| 38 | | } |
| 39 | | } elseif ( isset($_POST['post_type']) ) { |
| 40 | | $post_type_object = get_post_type_object($_POST['post_type']); |
| 41 | | if ( $post_type_object ) { |
| 42 | | $post_type = $post_type_object->name; |
| 43 | | $current_screen->post_type = $post_type; |
| 44 | | $current_screen->id = $current_screen->post_type; |
| 45 | | } |
| 46 | | } |
| | 20 | $post = get_post( $post_id ); |
| | 21 | $post_type_object = get_post_type_object( $typenow ); |
| | 22 | $post_type = $typenow; |
| 47 | 23 | |
| 48 | 24 | /** |
| 49 | 25 | * Redirect to previous page. |