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

git-svn-id: https://develop.svn.wordpress.org/trunk@12797 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2010-01-22 18:27:54 +00:00
parent 57577592b6
commit 8f1e29abd1
3 changed files with 49 additions and 25 deletions
+1 -24
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) ) {