Introduce set_current_screen(). Set current screen for inline edit ajax requests so post rows can be properly displayed. see #9674

git-svn-id: http://svn.automattic.com/wordpress/trunk@12797 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2010-01-22 18:27:54 +00:00
parent 92bf8d124c
commit a731cbed8e
3 changed files with 49 additions and 25 deletions

View File

@@ -112,30 +112,7 @@ 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);
set_current_screen();
// Handle plugin admin pages.
if ( isset($plugin_page) ) {