Merge edit-pages.php into edit.php. see #9674
git-svn-id: http://svn.automattic.com/wordpress/trunk@12728 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -177,4 +177,43 @@ if (isset($plugin_page)) {
|
||||
if ( !empty($_REQUEST['action']) )
|
||||
do_action('admin_action_' . $_REQUEST['action']);
|
||||
|
||||
$hook_suffix = '';
|
||||
if ( isset($page_hook) )
|
||||
$hook_suffix = $page_hook;
|
||||
else if ( isset($plugin_page) )
|
||||
$hook_suffix = $plugin_page;
|
||||
else if ( isset($pagenow) )
|
||||
$hook_suffix = $pagenow;
|
||||
|
||||
if ( isset($_GET['post_type']) )
|
||||
$typenow = $_GET['post_type'];
|
||||
else
|
||||
$typenow = '';
|
||||
// @todo validate typenow against post types.
|
||||
|
||||
/**
|
||||
* Global object containing info about the current screen.
|
||||
*/
|
||||
$current_screen = $hook_suffix;
|
||||
$current_screen = str_replace('.php', '', $current_screen);
|
||||
$current_screen = str_replace('-new', '', $current_screen);
|
||||
$current_screen = str_replace('-add', '', $current_screen);
|
||||
$current_screen = array('id' => $current_screen, 'base' => $current_screen);
|
||||
$current_screen = (object) $current_screen;
|
||||
if ( 'edit' == $current_screen->id ) {
|
||||
if ( empty($typenow) )
|
||||
$typenow = 'post';
|
||||
$current_screen->id .= '-' . $typenow;
|
||||
$current_screen->post_type = $typenow;
|
||||
} elseif ( 'post' == $current_screen->id ) {
|
||||
if ( empty($typenow) )
|
||||
$typenow = 'post';
|
||||
$current_screen->id = $typenow;
|
||||
$current_screen->post_type = $typenow;
|
||||
} else {
|
||||
$typenow = '';
|
||||
}
|
||||
|
||||
$current_screen = apply_filters('current_screen', $current_screen);
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user