Ticket #14886: ticket.14886.diff
| File ticket.14886.diff, 3.2 KB (added by , 15 years ago) |
|---|
-
wp-admin/includes/template.php
2042 2042 * @param string $id Screen id, optional. 2043 2043 */ 2044 2044 function set_current_screen( $id = '' ) { 2045 global $current_screen, $hook_suffix, $typenow, $taxnow ;2045 global $current_screen, $hook_suffix, $typenow, $taxnow, $post_id; 2046 2046 2047 2047 $action = ''; 2048 2048 … … 2083 2083 $current_screen->id .= '-' . $typenow; 2084 2084 $current_screen->post_type = $typenow; 2085 2085 } elseif ( 'post' == $current_screen->id ) { 2086 $post_id = isset($_GET['post']) ? (int) $_GET['post'] : 0; 2087 $post_id = isset($_POST['post_ID']) ? (int) $_POST['post_ID'] : $post_id; 2088 2089 if ( $post_id ) { 2090 $post = get_post( $post_id ); 2091 $typenow = $post->post_type; 2092 } 2093 2086 2094 if ( empty($typenow) ) 2087 2095 $typenow = 'post'; 2088 $current_screen->id = $typenow; 2089 $current_screen-> post_type = $typenow;2096 2097 $current_screen->id = $current_screen->post_type = $typenow; 2090 2098 } elseif ( 'edit-tags' == $current_screen->id ) { 2091 2099 if ( empty($taxnow) ) 2092 2100 $taxnow = 'post_tag'; 2101 if ( empty($typenow) ) 2102 $typenow = 'post'; 2093 2103 $current_screen->id = 'edit-' . $taxnow; 2094 2104 $current_screen->taxonomy = $taxnow; 2095 2105 } -
wp-admin/post.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 $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 } 19 $post = get_post( $post_id ); 20 $post_type_object = get_post_type_object( $current_screen->post_type ); 21 $post_type = $current_screen->post_type; 47 22 48 23 /** 49 24 * Redirect to previous page. -
wp-admin/admin.php
88 88 $plugin_page = plugin_basename($plugin_page); 89 89 } 90 90 91 if ( isset($_ GET['post_type']) )92 $typenow = sanitize_key( $_GET['post_type']);91 if ( isset($_REQUEST['post_type']) ) 92 $typenow = sanitize_key( $_REQUEST['post_type'] ); 93 93 else 94 94 $typenow = ''; 95 95 96 96 if ( isset($_GET['taxonomy']) ) 97 $taxnow = sanitize_key( $_GET['taxonomy']);97 $taxnow = sanitize_key( $_GET['taxonomy'] ); 98 98 else 99 99 $taxnow = ''; 100 100