Make WordPress Core


Ignore:
Timestamp:
01/22/2010 06:27:54 PM (15 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin.php

    r12753 r12797  
    113113// @todo validate typenow against post types.
    114114
    115 /**
    116  * Global object containing info about the current screen.
    117  */
    118 $current_screen = $hook_suffix;
    119 $current_screen = str_replace('.php', '', $current_screen);
    120 $current_screen = str_replace('-new', '', $current_screen);
    121 $current_screen = str_replace('-add', '', $current_screen);
    122 $current_screen = array('id' => $current_screen, 'base' => $current_screen);
    123 $current_screen = (object) $current_screen;
    124 if ( 'edit' == $current_screen->id ) {
    125     if ( empty($typenow) )
    126         $typenow = 'post';
    127     $current_screen->id .= '-' . $typenow;
    128     $current_screen->post_type = $typenow;
    129 } elseif ( 'post' == $current_screen->id ) {
    130     if ( empty($typenow) )
    131         $typenow = 'post';
    132     $current_screen->id = $typenow;
    133     $current_screen->post_type = $typenow;
    134 } else {
    135     $typenow = '';
    136 }
    137 
    138 $current_screen = apply_filters('current_screen', $current_screen);
     115set_current_screen();
    139116
    140117// Handle plugin admin pages.
Note: See TracChangeset for help on using the changeset viewer.