Changeset 12728 for trunk/wp-admin/admin.php
- Timestamp:
- 01/15/2010 04:58:36 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin.php
r12720 r12728 178 178 do_action('admin_action_' . $_REQUEST['action']); 179 179 180 $hook_suffix = ''; 181 if ( isset($page_hook) ) 182 $hook_suffix = $page_hook; 183 else if ( isset($plugin_page) ) 184 $hook_suffix = $plugin_page; 185 else if ( isset($pagenow) ) 186 $hook_suffix = $pagenow; 187 188 if ( isset($_GET['post_type']) ) 189 $typenow = $_GET['post_type']; 190 else 191 $typenow = ''; 192 // @todo validate typenow against post types. 193 194 /** 195 * Global object containing info about the current screen. 196 */ 197 $current_screen = $hook_suffix; 198 $current_screen = str_replace('.php', '', $current_screen); 199 $current_screen = str_replace('-new', '', $current_screen); 200 $current_screen = str_replace('-add', '', $current_screen); 201 $current_screen = array('id' => $current_screen, 'base' => $current_screen); 202 $current_screen = (object) $current_screen; 203 if ( 'edit' == $current_screen->id ) { 204 if ( empty($typenow) ) 205 $typenow = 'post'; 206 $current_screen->id .= '-' . $typenow; 207 $current_screen->post_type = $typenow; 208 } elseif ( 'post' == $current_screen->id ) { 209 if ( empty($typenow) ) 210 $typenow = 'post'; 211 $current_screen->id = $typenow; 212 $current_screen->post_type = $typenow; 213 } else { 214 $typenow = ''; 215 } 216 217 $current_screen = apply_filters('current_screen', $current_screen); 218 180 219 ?>
Note: See TracChangeset
for help on using the changeset viewer.