<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[12728] trunk/wp-admin: Merge edit-pages.php into edit.php.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12728">12728</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-01-15 16:58:36 +0000 (Fri, 15 Jan 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge edit-pages.php into edit.php. see <a href="http://trac.wordpress.org/ticket/9674">#9674</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminadminajaxphp">trunk/wp-admin/admin-ajax.php</a></li>
<li><a href="#trunkwpadminadminheaderphp">trunk/wp-admin/admin-header.php</a></li>
<li><a href="#trunkwpadminadminphp">trunk/wp-admin/admin.php</a></li>
<li><a href="#trunkwpadmineditformadvancedphp">trunk/wp-admin/edit-form-advanced.php</a></li>
<li><a href="#trunkwpadmineditlinkformphp">trunk/wp-admin/edit-link-form.php</a></li>
<li><a href="#trunkwpadmineditpostrowsphp">trunk/wp-admin/edit-post-rows.php</a></li>
<li><a href="#trunkwpadmineditphp">trunk/wp-admin/edit.php</a></li>
<li><a href="#trunkwpadminincludesmiscphp">trunk/wp-admin/includes/misc.php</a></li>
<li><a href="#trunkwpadminincludespostphp">trunk/wp-admin/includes/post.php</a></li>
<li><a href="#trunkwpadminincludestemplatephp">trunk/wp-admin/includes/template.php</a></li>
<li><a href="#trunkwpadminindexphp">trunk/wp-admin/index.php</a></li>
<li><a href="#trunkwpadminmenuphp">trunk/wp-admin/menu.php</a></li>
<li><a href="#trunkwpadminoptionsgeneralphp">trunk/wp-admin/options-general.php</a></li>
<li><a href="#trunkwpadminplugininstallphp">trunk/wp-admin/plugin-install.php</a></li>
<li><a href="#trunkwpadminpluginsphp">trunk/wp-admin/plugins.php</a></li>
<li><a href="#trunkwpadminpostnewphp">trunk/wp-admin/post-new.php</a></li>
<li><a href="#trunkwpadminpostphp">trunk/wp-admin/post.php</a></li>
<li><a href="#trunkwpadminthemeinstallphp">trunk/wp-admin/theme-install.php</a></li>
<li><a href="#trunkwpadminthemesphp">trunk/wp-admin/themes.php</a></li>
<li><a href="#trunkwpadminwidgetsphp">trunk/wp-admin/widgets.php</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkwpadmineditpagesphp">trunk/wp-admin/edit-pages.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminadminajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/admin-ajax.php (12727 => 12728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/admin-ajax.php        2010-01-15 16:39:11 UTC (rev 12727)
+++ trunk/wp-admin/admin-ajax.php        2010-01-15 16:58:36 UTC (rev 12728)
</span><span class="lines">@@ -1003,8 +1003,11 @@
</span><span class="cx"> case 'autosave-generate-nonces' :
</span><span class="cx">         check_ajax_referer( 'autosave', 'autosavenonce' );
</span><span class="cx">         $ID = (int) $_POST['post_ID'];
</span><del>-        $post_type = ( 'page' == $_POST['post_type'] ) ? 'page' : 'post';
-        if ( current_user_can( &quot;edit_{$post_type}&quot;, $ID ) )
</del><ins>+        $post_type = $_POST['post_type'];
+        $post_type_object = get_post_type_object($post_type);
+        if ( !$post_type_object )
+                die('0');
+        if ( current_user_can( $post_type_object-&gt;edit_cap, $ID ) )
</ins><span class="cx">                 die( json_encode( array( 'updateNonce' =&gt; wp_create_nonce( &quot;update-{$post_type}_{$ID}&quot; ), 'deleteURL' =&gt; str_replace( '&amp;amp;', '&amp;', wp_nonce_url( admin_url( $post_type . '.php?action=trash&amp;post=' . $ID ), &quot;trash-{$post_type}_{$ID}&quot; ) ) ) ) );
</span><span class="cx">         do_action('autosave_generate_nonces');
</span><span class="cx">         die('0');
</span></span></pre></div>
<a id="trunkwpadminadminheaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/admin-header.php (12727 => 12728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/admin-header.php        2010-01-15 16:39:11 UTC (rev 12727)
+++ trunk/wp-admin/admin-header.php        2010-01-15 16:58:36 UTC (rev 12728)
</span><span class="lines">@@ -29,21 +29,6 @@
</span><span class="cx">         wp_admin_css( 'css/ms' );
</span><span class="cx"> wp_enqueue_script('utils');
</span><span class="cx"> 
</span><del>-$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($submenu_file) &amp;&amp; (false !== $pos = strpos($submenu_file, 'post_type=')) )
-        $typenow = substr($submenu_file, $pos + 10);
-elseif ( isset($parent_file) &amp;&amp; (false !== $pos = strpos($parent_file, 'post_type=')) )
-        $typenow = substr($parent_file, $pos + 10);
-else
-        $typenow = '';
-
</del><span class="cx"> $admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix);
</span><span class="cx"> ?&gt;
</span><span class="cx"> &lt;script type=&quot;text/javascript&quot;&gt;
</span><span class="lines">@@ -119,16 +104,22 @@
</span><span class="cx"> &lt;a href=&quot;&lt;?php echo wp_logout_url() ?&gt;&quot; title=&quot;&lt;?php _e('Log Out') ?&gt;&quot;&gt;&lt;?php _e('Log Out'); ?&gt;&lt;/a&gt;&lt;/p&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;?php favorite_actions($hook_suffix); ?&gt;
</del><ins>+&lt;?php favorite_actions($current_screen); ?&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div id=&quot;wpbody&quot;&gt;
</span><del>-&lt;?php require(ABSPATH . 'wp-admin/menu-header.php'); ?&gt;
</del><ins>+&lt;?php
+require(ABSPATH . 'wp-admin/menu-header.php');
</ins><span class="cx"> 
</span><ins>+$current_screen-&gt;parent_file = $parent_file;
+$current_screen-&gt;parent_base = preg_replace('/\?.*$/', '', $parent_file);
+$current_screen-&gt;parent_base = str_replace('.php', '', $current_screen-&gt;parent_base);
+?&gt;
+
</ins><span class="cx"> &lt;div id=&quot;wpbody-content&quot;&gt;
</span><span class="cx"> &lt;?php
</span><del>-screen_meta($hook_suffix);
</del><ins>+screen_meta($current_screen);
</ins><span class="cx"> 
</span><span class="cx"> do_action('admin_notices');
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminadminphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/admin.php (12727 => 12728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/admin.php        2010-01-15 16:39:11 UTC (rev 12727)
+++ trunk/wp-admin/admin.php        2010-01-15 16:58:36 UTC (rev 12728)
</span><span class="lines">@@ -177,4 +177,43 @@
</span><span class="cx"> if ( !empty($_REQUEST['action']) )
</span><span class="cx">         do_action('admin_action_' . $_REQUEST['action']);
</span><span class="cx"> 
</span><ins>+$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' =&gt; $current_screen, 'base' =&gt; $current_screen);
+$current_screen = (object) $current_screen;
+if ( 'edit' == $current_screen-&gt;id ) {
+        if ( empty($typenow) )
+                $typenow = 'post';
+        $current_screen-&gt;id .= '-' . $typenow;
+        $current_screen-&gt;post_type = $typenow;
+} elseif ( 'post' == $current_screen-&gt;id ) {
+        if ( empty($typenow) )
+                $typenow = 'post';
+        $current_screen-&gt;id = $typenow;
+        $current_screen-&gt;post_type = $typenow;
+} else {
+        $typenow = '';
+}
+
+$current_screen = apply_filters('current_screen', $current_screen);
+
</ins><span class="cx"> ?&gt;
</span></span></pre></div>
<a id="trunkwpadmineditformadvancedphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-form-advanced.php (12727 => 12728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-form-advanced.php        2010-01-15 16:39:11 UTC (rev 12727)
+++ trunk/wp-admin/edit-form-advanced.php        2010-01-15 16:58:36 UTC (rev 12728)
</span><span class="lines">@@ -142,6 +142,8 @@
</span><span class="cx"> do_action('do_meta_boxes', $post_type, 'advanced', $post);
</span><span class="cx"> do_action('do_meta_boxes', $post_type, 'side', $post);
</span><span class="cx"> 
</span><ins>+add_contextual_help($current_screen, drag_drop_help());
+
</ins><span class="cx"> require_once('admin-header.php');
</span><span class="cx"> ?&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadmineditlinkformphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-link-form.php (12727 => 12728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-link-form.php        2010-01-15 16:39:11 UTC (rev 12727)
+++ trunk/wp-admin/edit-link-form.php        2010-01-15 16:58:36 UTC (rev 12728)
</span><span class="lines">@@ -34,6 +34,8 @@
</span><span class="cx"> do_action('do_meta_boxes', 'link', 'advanced', $link);
</span><span class="cx"> do_action('do_meta_boxes', 'link', 'side', $link);
</span><span class="cx"> 
</span><ins>+add_contextual_help($current_screen, drag_drop_help());
+
</ins><span class="cx"> require_once ('admin-header.php');
</span><span class="cx"> 
</span><span class="cx"> ?&gt;
</span></span></pre></div>
<a id="trunkwpadmineditpagesphp"></a>
<div class="delfile"><h4>Deleted: trunk/wp-admin/edit-pages.php (12727 => 12728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-pages.php        2010-01-15 16:39:11 UTC (rev 12727)
+++ trunk/wp-admin/edit-pages.php        2010-01-15 16:58:36 UTC (rev 12728)
</span><span class="lines">@@ -1,384 +0,0 @@
</span><del>-&lt;?php
-/**
- * Edit Pages Administration Panel.
- *
- * @package WordPress
- * @subpackage Administration
- */
-
-/** WordPress Administration Bootstrap */
-require_once('admin.php');
-
-if ( !current_user_can('edit_pages') )
-        wp_die(__('Cheatin&amp;#8217; uh?'));
-
-// Handle bulk actions
-if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) || isset($_GET['bulk_edit']) ) {
-        check_admin_referer('bulk-pages');
-        $sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer() );
-
-        if ( strpos($sendback, 'page.php') !== false )
-                $sendback = admin_url('post-new.php?post_type=page');
-
-        if ( isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {
-                $post_status = preg_replace('/[^a-z0-9_-]+/i', '', $_GET['post_status']);
-                $post_ids = $wpdb-&gt;get_col( $wpdb-&gt;prepare( &quot;SELECT ID FROM $wpdb-&gt;posts WHERE post_type='page' AND post_status = %s&quot;, $post_status ) );
-                $doaction = 'delete';
-        } elseif ( ( $_GET['action'] != -1 || $_GET['action2'] != -1 ) &amp;&amp; ( isset($_GET['post']) || isset($_GET['ids']) ) ) {
-                $post_ids = isset($_GET['post']) ? array_map( 'intval', (array) $_GET['post'] ) : explode(',', $_GET['ids']);
-                $doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2'];
-        } else {
-                wp_redirect( admin_url('edit-pages.php') );
-        }
-
-        switch ( $doaction ) {
-                case 'trash':
-                        $trashed = 0;
-                        foreach( (array) $post_ids as $post_id ) {
-                                if ( !current_user_can('delete_page', $post_id) )
-                                        wp_die( __('You are not allowed to move this page to the trash.') );
-
-                                if ( !wp_trash_post($post_id) )
-                                        wp_die( __('Error in moving to trash...') );
-
-                                $trashed++;
-                        }
-                        $sendback = add_query_arg( array('trashed' =&gt; $trashed, 'ids' =&gt; join(',', $post_ids)), $sendback );
-                        break;
-                case 'untrash':
-                        $untrashed = 0;
-                        foreach( (array) $post_ids as $post_id ) {
-                                if ( !current_user_can('delete_page', $post_id) )
-                                        wp_die( __('You are not allowed to restore this page from the trash.') );
-
-                                if ( !wp_untrash_post($post_id) )
-                                        wp_die( __('Error in restoring from trash...') );
-
-                                $untrashed++;
-                        }
-                        $sendback = add_query_arg('untrashed', $untrashed, $sendback);
-                        break;
-                case 'delete':
-                        $deleted = 0;
-                        foreach( (array) $post_ids as $post_id ) {
-                                $post_del = &amp; get_post($post_id);
-
-                                if ( !current_user_can('delete_page', $post_id) )
-                                        wp_die( __('You are not allowed to delete this page.') );
-
-                                if ( $post_del-&gt;post_type == 'attachment' ) {
-                                        if ( ! wp_delete_attachment($post_id) )
-                                                wp_die( __('Error in deleting...') );
-                                } else {
-                                        if ( !wp_delete_post($post_id) )
-                                                wp_die( __('Error in deleting...') );
-                                }
-                                $deleted++;
-                        }
-                        $sendback = add_query_arg('deleted', $deleted, $sendback);
-                        break;
-                case 'edit':
-                        $_GET['post_type'] = 'page';
-                        $done = bulk_edit_posts($_GET);
-
-                        if ( is_array($done) ) {
-                                $done['updated'] = count( $done['updated'] );
-                                $done['skipped'] = count( $done['skipped'] );
-                                $done['locked'] = count( $done['locked'] );
-                                $sendback = add_query_arg( $done, $sendback );
-                        }
-                        break;
-        }
-
-        if ( isset($_GET['action']) )
-                $sendback = remove_query_arg( array('action', 'action2', 'post_parent', 'page_template', 'post_author', 'comment_status', 'ping_status', '_status',  'post', 'bulk_edit', 'post_view', 'post_type'), $sendback );
-
-        wp_redirect($sendback);
-        exit();
-} elseif ( isset($_GET['_wp_http_referer']) &amp;&amp; ! empty($_GET['_wp_http_referer']) ) {
-         wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
-         exit;
-}
-
-if ( empty($title) )
-        $title = __('Edit Pages');
-$parent_file = 'edit-pages.php';
-wp_enqueue_script('inline-edit-post');
-
-$post_stati  = array(        //        array( adj, noun )
-                'publish' =&gt; array(_x('Published', 'page'), __('Published pages'), _nx_noop('Published &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Published &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'page')),
-                'future' =&gt; array(_x('Scheduled', 'page'), __('Scheduled pages'), _nx_noop('Scheduled &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Scheduled &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'page')),
-                'pending' =&gt; array(_x('Pending Review', 'page'), __('Pending pages'), _nx_noop('Pending Review &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Pending Review &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'page')),
-                'draft' =&gt; array(_x('Draft', 'page'), _x('Drafts', 'manage posts header'), _nx_noop('Draft &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Drafts &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'page')),
-                'private' =&gt; array(_x('Private', 'page'), __('Private pages'), _nx_noop('Private &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Private &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'page')),
-                'trash' =&gt; array(_x('Trash', 'page'), __('Trash pages'), _nx_noop('Trash &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Trash &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'page'))
-        );
-
-if ( !EMPTY_TRASH_DAYS )
-        unset($post_stati['trash']);
-
-$post_stati = apply_filters('page_stati', $post_stati);
-
-$query = array('post_type' =&gt; 'page', 'orderby' =&gt; 'menu_order title',
-        'posts_per_page' =&gt; -1, 'posts_per_archive_page' =&gt; -1, 'order' =&gt; 'asc');
-
-$post_status_label = __('Pages');
-if ( isset($_GET['post_status']) &amp;&amp; in_array( $_GET['post_status'], array_keys($post_stati) ) ) {
-        $post_status_label = $post_stati[$_GET['post_status']][1];
-        $query['post_status'] = $_GET['post_status'];
-        $query['perm'] = 'readable';
-}
-
-$query = apply_filters('manage_pages_query', $query);
-wp($query);
-
-if ( is_singular() ) {
-        wp_enqueue_script( 'admin-comments' );
-        enqueue_comment_hotkeys_js();
-}
-
-require_once('admin-header.php'); ?&gt;
-
-&lt;div class=&quot;wrap&quot;&gt;
-&lt;?php screen_icon(); ?&gt;
-&lt;h2&gt;&lt;?php echo esc_html( $title ); ?&gt; &lt;a href=&quot;post-new.php?post_type=page&quot; class=&quot;button add-new-h2&quot;&gt;&lt;?php echo esc_html_x('Add New', 'page'); ?&gt;&lt;/a&gt; &lt;?php
-if ( isset($_GET['s']) &amp;&amp; $_GET['s'] )
-        printf( '&lt;span class=&quot;subtitle&quot;&gt;' . __('Search results for &amp;#8220;%s&amp;#8221;') . '&lt;/span&gt;', esc_html( get_search_query() ) ); ?&gt;
-&lt;/h2&gt;
-
-&lt;?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) ) { ?&gt;
-&lt;div id=&quot;message&quot; class=&quot;updated&quot;&gt;&lt;p&gt;
-&lt;?php if ( isset($_GET['updated']) &amp;&amp; (int) $_GET['updated'] ) {
-        printf( _n( '%s page updated.', '%s pages updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) );
-        unset($_GET['updated']);
-}
-if ( isset($_GET['skipped']) &amp;&amp; (int) $_GET['skipped'] ) {
-        printf( _n( '%s page not updated, invalid parent page specified.', '%s pages not updated, invalid parent page specified.', $_GET['skipped'] ), number_format_i18n( $_GET['skipped'] ) );
-        unset($_GET['skipped']);
-}
-if ( isset($_GET['locked']) &amp;&amp; (int) $_GET['locked'] ) {
-        printf( _n( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['skipped'] ) );
-        unset($_GET['locked']);
-}
-if ( isset($_GET['deleted']) &amp;&amp; (int) $_GET['deleted'] ) {
-        printf( _n( 'Page permanently deleted.', '%s pages permanently deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
-        unset($_GET['deleted']);
-}
-if ( isset($_GET['trashed']) &amp;&amp; (int) $_GET['trashed'] ) {
-        printf( _n( 'Page moved to the trash.', '%s pages moved to the trash.', $_GET['trashed'] ), number_format_i18n( $_GET['trashed'] ) );
-        $ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
-        echo ' &lt;a href=&quot;' . esc_url( wp_nonce_url( &quot;edit-pages.php?doaction=undo&amp;action=untrash&amp;ids=$ids&quot;, &quot;bulk-pages&quot; ) ) . '&quot;&gt;' . __('Undo') . '&lt;/a&gt;&lt;br /&gt;';
-        unset($_GET['trashed']);
-}
-if ( isset($_GET['untrashed']) &amp;&amp; (int) $_GET['untrashed'] ) {
-        printf( _n( 'Page restored from the trash.', '%s pages restored from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) );
-        unset($_GET['untrashed']);
-}
-$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed'), $_SERVER['REQUEST_URI'] );
-?&gt;
-&lt;/p&gt;&lt;/div&gt;
-&lt;?php } ?&gt;
-
-&lt;?php if ( isset($_GET['posted']) &amp;&amp; $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?&gt;
-&lt;div id=&quot;message&quot; class=&quot;updated&quot;&gt;&lt;p&gt;&lt;strong&gt;&lt;?php _e('Your page has been saved.'); ?&gt;&lt;/strong&gt; &lt;a href=&quot;&lt;?php echo get_permalink( $_GET['posted'] ); ?&gt;&quot;&gt;&lt;?php _e('View page'); ?&gt;&lt;/a&gt; | &lt;a href=&quot;&lt;?php echo get_edit_post_link( $_GET['posted'] ); ?&gt;&quot;&gt;&lt;?php _e('Edit page'); ?&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
-&lt;?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
-endif; ?&gt;
-
-&lt;form id=&quot;posts-filter&quot; action=&quot;&lt;?php echo admin_url('edit-pages.php'); ?&gt;&quot; method=&quot;get&quot;&gt;
-&lt;ul class=&quot;subsubsub&quot;&gt;
-&lt;?php
-
-$avail_post_stati = get_available_post_statuses('page');
-if ( empty($locked_post_status) ) :
-$status_links = array();
-$num_posts = wp_count_posts('page', 'readable');
-$total_posts = array_sum( (array) $num_posts ) - $num_posts-&gt;trash;
-$class = empty($_GET['post_status']) ? ' class=&quot;current&quot;' : '';
-$status_links[] = &quot;&lt;li&gt;&lt;a href='edit-pages.php'$class&gt;&quot; . sprintf( _nx( 'All &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'All &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', $total_posts, 'pages' ), number_format_i18n( $total_posts ) ) . '&lt;/a&gt;';
-foreach ( $post_stati as $status =&gt; $label ) {
-        $class = '';
-
-        if ( !in_array($status, $avail_post_stati) || $num_posts-&gt;$status &lt;= 0 )
-                continue;
-
-        if ( isset( $_GET['post_status'] ) &amp;&amp; $status == $_GET['post_status'] )
-                $class = ' class=&quot;current&quot;';
-
-        $status_links[] = &quot;&lt;li&gt;&lt;a href='edit-pages.php?post_status=$status'$class&gt;&quot; . sprintf( _nx( $label[2][0], $label[2][1], $num_posts-&gt;$status, $label[2][2] ), number_format_i18n( $num_posts-&gt;$status ) ) . '&lt;/a&gt;';
-}
-echo implode( &quot; |&lt;/li&gt;\n&quot;, $status_links ) . '&lt;/li&gt;';
-unset($status_links);
-endif;
-?&gt;
-&lt;/ul&gt;
-
-&lt;p class=&quot;search-box&quot;&gt;
-        &lt;label class=&quot;screen-reader-text&quot; for=&quot;page-search-input&quot;&gt;&lt;?php _e( 'Search Pages' ); ?&gt;:&lt;/label&gt;
-        &lt;input type=&quot;text&quot; id=&quot;page-search-input&quot; name=&quot;s&quot; value=&quot;&lt;?php _admin_search_query(); ?&gt;&quot; /&gt;
-        &lt;input type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e( 'Search Pages' ); ?&gt;&quot; class=&quot;button&quot; /&gt;
-&lt;/p&gt;
-
-&lt;input type=&quot;hidden&quot; name=&quot;post_status&quot; class=&quot;post_status_page&quot; value=&quot;&lt;?php echo !empty($_GET['post_status']) ? esc_attr($_GET['post_status']) : 'all'; ?&gt;&quot; /&gt;
-
-&lt;?php if ($posts) { ?&gt;
-
-&lt;div class=&quot;tablenav&quot;&gt;
-
-&lt;?php
-$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
-if ( empty($pagenum) )
-        $pagenum = 1;
-$per_page = (int) get_user_option( 'edit_pages_per_page' );
-if ( empty( $per_page ) || $per_page &lt; 1 )
-        $per_page = 20;
-$per_page = apply_filters( 'edit_pages_per_page', $per_page );
-
-$num_pages = ceil($wp_query-&gt;post_count / $per_page);
-$page_links = paginate_links( array(
-        'base' =&gt; add_query_arg( 'pagenum', '%#%' ),
-        'format' =&gt; '',
-        'prev_text' =&gt; __('&amp;laquo;'),
-        'next_text' =&gt; __('&amp;raquo;'),
-        'total' =&gt; $num_pages,
-        'current' =&gt; $pagenum
-));
-
-$is_trash = isset($_GET['post_status']) &amp;&amp; $_GET['post_status'] == 'trash';
-
-if ( $page_links ) : ?&gt;
-&lt;div class=&quot;tablenav-pages&quot;&gt;&lt;?php $page_links_text = sprintf( '&lt;span class=&quot;displaying-num&quot;&gt;' . __( 'Displaying %s&amp;#8211;%s of %s' ) . '&lt;/span&gt;%s',
-        number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ),
-        number_format_i18n( min( $pagenum * $per_page, $wp_query-&gt;post_count ) ),
-        number_format_i18n( $wp_query-&gt;post_count ),
-        $page_links
-); echo $page_links_text; ?&gt;&lt;/div&gt;
-&lt;?php endif; ?&gt;
-
-&lt;div class=&quot;alignleft actions&quot;&gt;
-&lt;select name=&quot;action&quot;&gt;
-&lt;option value=&quot;-1&quot; selected=&quot;selected&quot;&gt;&lt;?php _e('Bulk Actions'); ?&gt;&lt;/option&gt;
-&lt;?php if ( $is_trash ) { ?&gt;
-&lt;option value=&quot;untrash&quot;&gt;&lt;?php _e('Restore'); ?&gt;&lt;/option&gt;
-&lt;?php } else { ?&gt;
-&lt;option value=&quot;edit&quot;&gt;&lt;?php _e('Edit'); ?&gt;&lt;/option&gt;
-&lt;?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?&gt;
-&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete Permanently'); ?&gt;&lt;/option&gt;
-&lt;?php } else { ?&gt;
-&lt;option value=&quot;trash&quot;&gt;&lt;?php _e('Move to Trash'); ?&gt;&lt;/option&gt;
-&lt;?php } ?&gt;
-&lt;/select&gt;
-&lt;input type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e('Apply'); ?&gt;&quot; name=&quot;doaction&quot; id=&quot;doaction&quot; class=&quot;button-secondary action&quot; /&gt;
-&lt;?php wp_nonce_field('bulk-pages'); ?&gt;
-&lt;?php if ( $is_trash ) { ?&gt;
-&lt;input type=&quot;submit&quot; name=&quot;delete_all&quot; id=&quot;delete_all&quot; value=&quot;&lt;?php esc_attr_e('Empty Trash'); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
-&lt;?php } ?&gt;
-&lt;/div&gt;
-
-&lt;br class=&quot;clear&quot; /&gt;
-&lt;/div&gt;
-
-&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
-
-&lt;table class=&quot;widefat page fixed&quot; cellspacing=&quot;0&quot;&gt;
-  &lt;thead&gt;
-  &lt;tr&gt;
-&lt;?php print_column_headers('edit-pages'); ?&gt;
-  &lt;/tr&gt;
-  &lt;/thead&gt;
-
-  &lt;tfoot&gt;
-  &lt;tr&gt;
-&lt;?php print_column_headers('edit-pages', false); ?&gt;
-  &lt;/tr&gt;
-  &lt;/tfoot&gt;
-
-  &lt;tbody&gt;
-  &lt;?php page_rows($posts, $pagenum, $per_page); ?&gt;
-  &lt;/tbody&gt;
-&lt;/table&gt;
-
-&lt;div class=&quot;tablenav&quot;&gt;
-&lt;?php
-if ( $page_links )
-        echo &quot;&lt;div class='tablenav-pages'&gt;$page_links_text&lt;/div&gt;&quot;;
-?&gt;
-
-&lt;div class=&quot;alignleft actions&quot;&gt;
-&lt;select name=&quot;action2&quot;&gt;
-&lt;option value=&quot;-1&quot; selected=&quot;selected&quot;&gt;&lt;?php _e('Bulk Actions'); ?&gt;&lt;/option&gt;
-&lt;?php if ( $is_trash ) { ?&gt;
-&lt;option value=&quot;untrash&quot;&gt;&lt;?php _e('Restore'); ?&gt;&lt;/option&gt;
-&lt;?php } else { ?&gt;
-&lt;option value=&quot;edit&quot;&gt;&lt;?php _e('Edit'); ?&gt;&lt;/option&gt;
-&lt;?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?&gt;
-&lt;option value=&quot;delete&quot;&gt;&lt;?php _e('Delete Permanently'); ?&gt;&lt;/option&gt;
-&lt;?php } else { ?&gt;
-&lt;option value=&quot;trash&quot;&gt;&lt;?php _e('Move to Trash'); ?&gt;&lt;/option&gt;
-&lt;?php } ?&gt;
-&lt;/select&gt;
-&lt;input type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e('Apply'); ?&gt;&quot; name=&quot;doaction2&quot; id=&quot;doaction2&quot; class=&quot;button-secondary action&quot; /&gt;
-&lt;?php if ( $is_trash ) { ?&gt;
-&lt;input type=&quot;submit&quot; name=&quot;delete_all2&quot; id=&quot;delete_all2&quot; value=&quot;&lt;?php esc_attr_e('Empty Trash'); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
-&lt;?php } ?&gt;
-&lt;/div&gt;
-
-&lt;br class=&quot;clear&quot; /&gt;
-&lt;/div&gt;
-
-&lt;?php } else { ?&gt;
-&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
-&lt;p&gt;&lt;?php _e('No pages found.') ?&gt;&lt;/p&gt;
-&lt;?php
-} // end if ($posts)
-?&gt;
-
-&lt;/form&gt;
-
-&lt;?php inline_edit_row( 'page' ) ?&gt;
-
-&lt;div id=&quot;ajax-response&quot;&gt;&lt;/div&gt;
-
-
-&lt;?php
-
-if ( 1 == count($posts) &amp;&amp; is_singular() ) :
-
-        $comments = $wpdb-&gt;get_results( $wpdb-&gt;prepare(&quot;SELECT * FROM $wpdb-&gt;comments WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date&quot;, $id) );
-        if ( $comments ) :
-                // Make sure comments, post, and post_author are cached
-                update_comment_cache($comments);
-                $post = get_post($id);
-                $authordata = get_userdata($post-&gt;post_author);
-        ?&gt;
-
-&lt;br class=&quot;clear&quot; /&gt;
-
-&lt;table class=&quot;widefat&quot; cellspacing=&quot;0&quot;&gt;
-&lt;thead&gt;
-  &lt;tr&gt;
-    &lt;th scope=&quot;col&quot; class=&quot;column-comment&quot;&gt;
-                &lt;?php  /* translators: column name */ echo _x('Comment', 'column name') ?&gt;
-        &lt;/th&gt;
-    &lt;th scope=&quot;col&quot; class=&quot;column-author&quot;&gt;&lt;?php _e('Author') ?&gt;&lt;/th&gt;
-    &lt;th scope=&quot;col&quot; class=&quot;column-date&quot;&gt;&lt;?php _e('Submitted') ?&gt;&lt;/th&gt;
-  &lt;/tr&gt;
-&lt;/thead&gt;
-&lt;tbody id=&quot;the-comment-list&quot; class=&quot;list:comment&quot;&gt;
-&lt;?php
-        foreach ($comments as $comment)
-                _wp_comment_row( $comment-&gt;comment_ID, 'single', false, false );
-?&gt;
-&lt;/tbody&gt;
-&lt;/table&gt;
-
-&lt;?php
-wp_comment_reply();
-endif; // comments
-endif; // posts;
-
-?&gt;
-
-&lt;/div&gt;
-
-&lt;?php
-include('admin-footer.php');
</del></span></pre></div>
<a id="trunkwpadmineditpostrowsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-post-rows.php (12727 => 12728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-post-rows.php        2010-01-15 16:39:11 UTC (rev 12727)
+++ trunk/wp-admin/edit-post-rows.php        2010-01-15 16:58:36 UTC (rev 12728)
</span><span class="lines">@@ -13,17 +13,22 @@
</span><span class="cx"> &lt;table class=&quot;widefat post fixed&quot; cellspacing=&quot;0&quot;&gt;
</span><span class="cx">         &lt;thead&gt;
</span><span class="cx">         &lt;tr&gt;
</span><del>-&lt;?php print_column_headers('edit'); ?&gt;
</del><ins>+&lt;?php print_column_headers( $current_screen ); ?&gt;
</ins><span class="cx">         &lt;/tr&gt;
</span><span class="cx">         &lt;/thead&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;tfoot&gt;
</span><span class="cx">         &lt;tr&gt;
</span><del>-&lt;?php print_column_headers('edit', false); ?&gt;
</del><ins>+&lt;?php print_column_headers($current_screen, false); ?&gt;
</ins><span class="cx">         &lt;/tr&gt;
</span><span class="cx">         &lt;/tfoot&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;tbody&gt;
</span><del>-&lt;?php post_rows(); ?&gt;
</del><ins>+&lt;?php
+if ( $post_type_object-&gt;hierarchical )
+        page_rows($posts, $pagenum, $per_page);
+else
+        post_rows();
+?&gt;
</ins><span class="cx">         &lt;/tbody&gt;
</span><span class="cx"> &lt;/table&gt;
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadmineditphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit.php (12727 => 12728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit.php        2010-01-15 16:39:11 UTC (rev 12727)
+++ trunk/wp-admin/edit.php        2010-01-15 16:58:36 UTC (rev 12728)
</span><span class="lines">@@ -20,13 +20,14 @@
</span><span class="cx">         unset( $_redirect );
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-if ( isset($_GET['post_type']) &amp;&amp; in_array( $_GET['post_type'], get_post_types( array('_show' =&gt; true) ) ) )
</del><ins>+if ( isset($_GET['post_type']) &amp;&amp; ( in_array( $_GET['post_type'], get_post_types( array('_show' =&gt; true ) ) ) || in_array( $_GET['post_type'], get_post_types( array('_builtin' =&gt; true ) ) ) ) )
</ins><span class="cx">         $post_type = $_GET['post_type'];
</span><span class="cx"> else
</span><span class="cx">         $post_type = 'post';
</span><span class="cx"> $_GET['post_type'] = $post_type;
</span><span class="cx"> 
</span><span class="cx"> $post_type_object = get_post_type_object($post_type);
</span><ins>+$post_type_cap = $post_type_object-&gt;capability_type;
</ins><span class="cx"> 
</span><span class="cx"> if ( 'post' != $post_type ) {
</span><span class="cx">         $parent_file = &quot;edit.php?post_type=$post_type&quot;;
</span><span class="lines">@@ -38,6 +39,16 @@
</span><span class="cx">         $post_new_file = 'post-new.php';
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+$pagenum = isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 0;
+if ( empty($pagenum) )
+        $pagenum = 1;
+$per_page = 'edit_' . $post_type . '_per_page';
+$per_page = (int) get_user_option( $per_page );
+if ( empty( $per_page ) || $per_page &lt; 1 )
+        $per_page = 15;
+// @todo filter based on type
+$per_page = apply_filters( 'edit_posts_per_page', $per_page );
+
</ins><span class="cx"> // Handle bulk actions
</span><span class="cx"> if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) || isset($_GET['bulk_edit']) ) {
</span><span class="cx">         check_admin_referer('bulk-posts');
</span><span class="lines">@@ -61,8 +72,8 @@
</span><span class="cx">                 case 'trash':
</span><span class="cx">                         $trashed = 0;
</span><span class="cx">                         foreach( (array) $post_ids as $post_id ) {
</span><del>-                                if ( !current_user_can('delete_post', $post_id) )
-                                        wp_die( __('You are not allowed to move this post to the trash.') );
</del><ins>+                                if ( !current_user_can('delete_' . $post_type_cap, $post_id) )
+                                        wp_die( __('You are not allowed to move this item to the trash.') );
</ins><span class="cx"> 
</span><span class="cx">                                 if ( !wp_trash_post($post_id) )
</span><span class="cx">                                         wp_die( __('Error in moving to trash...') );
</span><span class="lines">@@ -74,8 +85,8 @@
</span><span class="cx">                 case 'untrash':
</span><span class="cx">                         $untrashed = 0;
</span><span class="cx">                         foreach( (array) $post_ids as $post_id ) {
</span><del>-                                if ( !current_user_can('delete_post', $post_id) )
-                                        wp_die( __('You are not allowed to restore this post from the trash.') );
</del><ins>+                                if ( !current_user_can('delete_' . $post_type_cap, $post_id) )
+                                        wp_die( __('You are not allowed to restore this item from the trash.') );
</ins><span class="cx"> 
</span><span class="cx">                                 if ( !wp_untrash_post($post_id) )
</span><span class="cx">                                         wp_die( __('Error in restoring from trash...') );
</span><span class="lines">@@ -89,8 +100,8 @@
</span><span class="cx">                         foreach( (array) $post_ids as $post_id ) {
</span><span class="cx">                                 $post_del = &amp; get_post($post_id);
</span><span class="cx"> 
</span><del>-                                if ( !current_user_can('delete_post', $post_id) )
-                                        wp_die( __('You are not allowed to delete this post.') );
</del><ins>+                                if ( !current_user_can('delete_' .  $post_type_cap, $post_id) )
+                                        wp_die( __('You are not allowed to delete this item.') );
</ins><span class="cx"> 
</span><span class="cx">                                 if ( $post_del-&gt;post_type == 'attachment' ) {
</span><span class="cx">                                         if ( ! wp_delete_attachment($post_id) )
</span><span class="lines">@@ -130,7 +141,7 @@
</span><span class="cx"> wp_enqueue_script('inline-edit-post');
</span><span class="cx"> 
</span><span class="cx"> $user_posts = false;
</span><del>-if ( !current_user_can('edit_others_posts') ) {
</del><ins>+if ( !current_user_can('edit_others_' . $post_type_cap . 's') ) {
</ins><span class="cx">         $user_posts_count = $wpdb-&gt;get_var( $wpdb-&gt;prepare(&quot;SELECT COUNT(1) FROM $wpdb-&gt;posts WHERE post_type = '%s' AND post_status != 'trash' AND post_author = %d&quot;, $post_type, $current_user-&gt;ID) );
</span><span class="cx">         $user_posts = true;
</span><span class="cx">         if ( $user_posts_count &amp;&amp; empty($_GET['post_status']) &amp;&amp; empty($_GET['all_posts']) &amp;&amp; empty($_GET['author']) )
</span><span class="lines">@@ -139,11 +150,13 @@
</span><span class="cx"> 
</span><span class="cx"> $avail_post_stati = wp_edit_posts_query();
</span><span class="cx"> 
</span><ins>+if ( $post_type_object-&gt;hierarchical )
+        $num_pages = ceil($wp_query-&gt;post_count / $per_page);
+else
+        $num_pages = $wp_query-&gt;max_num_pages;
+
</ins><span class="cx"> require_once('admin-header.php');
</span><span class="cx"> 
</span><del>-if ( !isset( $_GET['paged'] ) )
-        $_GET['paged'] = 1;
-
</del><span class="cx"> if ( empty($_GET['mode']) )
</span><span class="cx">         $mode = 'list';
</span><span class="cx"> else
</span><span class="lines">@@ -158,7 +171,7 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;?php
</span><span class="cx"> if ( isset($_GET['posted']) &amp;&amp; $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?&gt;
</span><del>-&lt;div id=&quot;message&quot; class=&quot;updated&quot;&gt;&lt;p&gt;&lt;strong&gt;&lt;?php _e('Your post has been saved.'); ?&gt;&lt;/strong&gt; &lt;a href=&quot;&lt;?php echo get_permalink( $_GET['posted'] ); ?&gt;&quot;&gt;&lt;?php _e('View post'); ?&gt;&lt;/a&gt; | &lt;a href=&quot;&lt;?php echo get_edit_post_link( $_GET['posted'] ); ?&gt;&quot;&gt;&lt;?php _e('Edit post'); ?&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
</del><ins>+&lt;div id=&quot;message&quot; class=&quot;updated&quot;&gt;&lt;p&gt;&lt;strong&gt;&lt;?php _e('This has been saved.'); ?&gt;&lt;/strong&gt; &lt;a href=&quot;&lt;?php echo get_permalink( $_GET['posted'] ); ?&gt;&quot;&gt;&lt;?php _e('View post'); ?&gt;&lt;/a&gt; | &lt;a href=&quot;&lt;?php echo get_edit_post_link( $_GET['posted'] ); ?&gt;&quot;&gt;&lt;?php _e('Edit post'); ?&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
</ins><span class="cx"> &lt;?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
</span><span class="cx"> endif; ?&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -173,24 +186,24 @@
</span><span class="cx">         unset($_GET['skipped']);
</span><span class="cx"> 
</span><span class="cx"> if ( isset($_GET['locked']) &amp;&amp; (int) $_GET['locked'] ) {
</span><del>-        printf( _n( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['locked'] ) );
</del><ins>+        printf( _n( '%s item not updated, somebody is editing it.', '%s items not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['locked'] ) );
</ins><span class="cx">         unset($_GET['locked']);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> if ( isset($_GET['deleted']) &amp;&amp; (int) $_GET['deleted'] ) {
</span><del>-        printf( _n( 'Post permanently deleted.', '%s posts permanently deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
</del><ins>+        printf( _n( 'Item permanently deleted.', '%s items permanently deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
</ins><span class="cx">         unset($_GET['deleted']);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> if ( isset($_GET['trashed']) &amp;&amp; (int) $_GET['trashed'] ) {
</span><del>-        printf( _n( 'Post moved to the trash.', '%s posts moved to the trash.', $_GET['trashed'] ), number_format_i18n( $_GET['trashed'] ) );
</del><ins>+        printf( _n( 'Item moved to the trash.', '%s items moved to the trash.', $_GET['trashed'] ), number_format_i18n( $_GET['trashed'] ) );
</ins><span class="cx">         $ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
</span><span class="cx">         echo ' &lt;a href=&quot;' . esc_url( wp_nonce_url( &quot;edit.php?doaction=undo&amp;action=untrash&amp;ids=$ids&quot;, &quot;bulk-posts&quot; ) ) . '&quot;&gt;' . __('Undo') . '&lt;/a&gt;&lt;br /&gt;';
</span><span class="cx">         unset($_GET['trashed']);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> if ( isset($_GET['untrashed']) &amp;&amp; (int) $_GET['untrashed'] ) {
</span><del>-        printf( _n( 'Post restored from the trash.', '%s posts restored from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) );
</del><ins>+        printf( _n( 'Item restored from the trash.', '%s items restored from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) );
</ins><span class="cx">         unset($_GET['undeleted']);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -212,7 +225,7 @@
</span><span class="cx"> if ( $user_posts ) {
</span><span class="cx">         if ( isset( $_GET['author'] ) &amp;&amp; ( $_GET['author'] == $current_user-&gt;ID ) )
</span><span class="cx">                 $class = ' class=&quot;current&quot;';
</span><del>-        $status_links[] = &quot;&lt;li&gt;&lt;a href='edit.php?author=$current_user-&gt;ID'$class&gt;&quot; . sprintf( _nx( 'My Posts &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'My Posts &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', $user_posts_count, 'posts' ), number_format_i18n( $user_posts_count ) ) . '&lt;/a&gt;';
</del><ins>+        $status_links[] = &quot;&lt;li&gt;&lt;a href='edit.php?author=$current_user-&gt;ID'$class&gt;&quot; . sprintf( _nx( 'Mine &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'Mine &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', $user_posts_count, 'posts' ), number_format_i18n( $user_posts_count ) ) . '&lt;/a&gt;';
</ins><span class="cx">         $allposts = '?all_posts=1';
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -261,8 +274,8 @@
</span><span class="cx">         'format' =&gt; '',
</span><span class="cx">         'prev_text' =&gt; __('&amp;laquo;'),
</span><span class="cx">         'next_text' =&gt; __('&amp;raquo;'),
</span><del>-        'total' =&gt; $wp_query-&gt;max_num_pages,
-        'current' =&gt; $_GET['paged']
</del><ins>+        'total' =&gt; $num_pages,
+        'current' =&gt; $pagenum
</ins><span class="cx"> ));
</span><span class="cx"> 
</span><span class="cx"> $is_trash = isset($_GET['post_status']) &amp;&amp; $_GET['post_status'] == 'trash';
</span><span class="lines">@@ -318,23 +331,25 @@
</span><span class="cx"> &lt;?php } ?&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;?php
</span><del>-$dropdown_options = array('show_option_all' =&gt; __('View all categories'), 'hide_empty' =&gt; 0, 'hierarchical' =&gt; 1,
-        'show_count' =&gt; 0, 'orderby' =&gt; 'name', 'selected' =&gt; $cat);
-wp_dropdown_categories($dropdown_options);
-do_action('restrict_manage_posts');
</del><ins>+if ( is_object_in_taxonomy($post_type, 'category') ) {
+        $dropdown_options = array('show_option_all' =&gt; __('View all categories'), 'hide_empty' =&gt; 0, 'hierarchical' =&gt; 1,
+                'show_count' =&gt; 0, 'orderby' =&gt; 'name', 'selected' =&gt; $cat);
+        wp_dropdown_categories($dropdown_options);
+        do_action('restrict_manage_posts');
+}
</ins><span class="cx"> ?&gt;
</span><span class="cx"> &lt;input type=&quot;submit&quot; id=&quot;post-query-submit&quot; value=&quot;&lt;?php esc_attr_e('Filter'); ?&gt;&quot; class=&quot;button-secondary&quot; /&gt;
</span><span class="cx"> &lt;?php }
</span><span class="cx"> 
</span><del>-if ( $is_trash &amp;&amp; current_user_can('edit_others_posts') ) { ?&gt;
</del><ins>+if ( $is_trash &amp;&amp; current_user_can('edit_others_' . $post_type_cap .'s') ) { ?&gt;
</ins><span class="cx"> &lt;input type=&quot;submit&quot; name=&quot;delete_all&quot; id=&quot;delete_all&quot; value=&quot;&lt;?php esc_attr_e('Empty Trash'); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
</span><span class="cx"> &lt;?php } ?&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;?php if ( $page_links ) { ?&gt;
</span><span class="cx"> &lt;div class=&quot;tablenav-pages&quot;&gt;&lt;?php $page_links_text = sprintf( '&lt;span class=&quot;displaying-num&quot;&gt;' . __( 'Displaying %s&amp;#8211;%s of %s' ) . '&lt;/span&gt;%s',
</span><del>-        number_format_i18n( ( $_GET['paged'] - 1 ) * $wp_query-&gt;query_vars['posts_per_page'] + 1 ),
-        number_format_i18n( min( $_GET['paged'] * $wp_query-&gt;query_vars['posts_per_page'], $wp_query-&gt;found_posts ) ),
</del><ins>+        number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ),
+        number_format_i18n( min( $pagenum * $per_page, $wp_query-&gt;found_posts ) ),
</ins><span class="cx">         number_format_i18n( $wp_query-&gt;found_posts ),
</span><span class="cx">         $page_links
</span><span class="cx"> ); echo $page_links_text; ?&gt;&lt;/div&gt;
</span><span class="lines">@@ -373,7 +388,7 @@
</span><span class="cx"> &lt;?php } ?&gt;
</span><span class="cx"> &lt;/select&gt;
</span><span class="cx"> &lt;input type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e('Apply'); ?&gt;&quot; name=&quot;doaction2&quot; id=&quot;doaction2&quot; class=&quot;button-secondary action&quot; /&gt;
</span><del>-&lt;?php if ( $is_trash &amp;&amp; current_user_can('edit_others_posts') ) { ?&gt;
</del><ins>+&lt;?php if ( $is_trash &amp;&amp; current_user_can('edit_others_' . $post_type_cap . 's') ) { ?&gt;
</ins><span class="cx"> &lt;input type=&quot;submit&quot; name=&quot;delete_all2&quot; id=&quot;delete_all2&quot; value=&quot;&lt;?php esc_attr_e('Empty Trash'); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
</span><span class="cx"> &lt;?php } ?&gt;
</span><span class="cx"> &lt;br class=&quot;clear&quot; /&gt;
</span><span class="lines">@@ -393,7 +408,7 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;/form&gt;
</span><span class="cx"> 
</span><del>-&lt;?php inline_edit_row( 'post' ); ?&gt;
</del><ins>+&lt;?php inline_edit_row( $current_screen ); ?&gt;
</ins><span class="cx"> 
</span><span class="cx"> &lt;div id=&quot;ajax-response&quot;&gt;&lt;/div&gt;
</span><span class="cx"> &lt;br class=&quot;clear&quot; /&gt;
</span></span></pre></div>
<a id="trunkwpadminincludesmiscphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/misc.php (12727 => 12728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/misc.php        2010-01-15 16:39:11 UTC (rev 12727)
+++ trunk/wp-admin/includes/misc.php        2010-01-15 16:58:36 UTC (rev 12728)
</span><span class="lines">@@ -410,7 +410,6 @@
</span><span class="cx"> 
</span><span class="cx">                 switch ( $map_option ) {
</span><span class="cx">                         case 'edit_per_page':
</span><del>-                        case 'edit_pages_per_page':
</del><span class="cx">                         case 'edit_comments_per_page':
</span><span class="cx">                         case 'upload_per_page':
</span><span class="cx">                         case 'categories_per_page':
</span></span></pre></div>
<a id="trunkwpadminincludespostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/post.php (12727 => 12728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/post.php        2010-01-15 16:39:11 UTC (rev 12727)
+++ trunk/wp-admin/includes/post.php        2010-01-15 16:58:36 UTC (rev 12728)
</span><span class="lines">@@ -819,10 +819,11 @@
</span><span class="cx">         $q['cat'] = isset($q['cat']) ? (int) $q['cat'] : 0;
</span><span class="cx">         $post_stati  = get_post_stati();
</span><span class="cx"> 
</span><del>-        if ( isset($q['post_type']) &amp;&amp; in_array( $q['post_type'], get_post_types( array('_show' =&gt; true) ) ) )
</del><ins>+        if ( isset($q['post_type']) &amp;&amp; in_array( $q['post_type'], get_post_types() ) )
</ins><span class="cx">                 $post_type = $q['post_type'];
</span><span class="cx">         else
</span><span class="cx">                 $post_type = 'post';
</span><ins>+        $post_type_object = get_post_type_object($post_type);
</ins><span class="cx"> 
</span><span class="cx">         $avail_post_stati = get_available_post_statuses($post_type);
</span><span class="cx"> 
</span><span class="lines">@@ -842,17 +843,25 @@
</span><span class="cx">                 $orderby = 'date';
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if ( 'post' != $post_type )
-                $per_page = 'edit_' . $post_type . '_per_page';
-        else
-                $per_page = 'edit_per_page';
-        $posts_per_page = (int) get_user_option( 'edit_per_page' );
</del><ins>+        $per_page = 'edit_' . $post_type . '_per_page';
+        $posts_per_page = (int) get_user_option( $per_page );
</ins><span class="cx">         if ( empty( $posts_per_page ) || $posts_per_page &lt; 1 )
</span><span class="cx">                 $posts_per_page = 15;
</span><del>-        $posts_per_page = apply_filters( 'edit_posts_per_page', $posts_per_page );
</del><ins>+        $posts_per_page = apply_filters( $per_page, $posts_per_page );
</ins><span class="cx"> 
</span><del>-        wp( compact('post_type', 'post_status', 'perm', 'order', 'orderby', 'posts_per_page') );
</del><span class="cx"> 
</span><ins>+        $query = compact('post_type', 'post_status', 'perm', 'order', 'orderby', 'posts_per_page');
+
+        // Hierarchical types require special args.
+        if ( $post_type_object-&gt;hierarchical ) {
+                $query['orderby'] = 'menu_order title';
+                $query['order'] = 'asc';
+                $query['posts_per_page'] = -1;
+                $query['posts_per_archive_page'] = -1;
+        }
+
+        wp( $query );
+
</ins><span class="cx">         return $avail_post_stati;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminincludestemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/template.php (12727 => 12728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/template.php        2010-01-15 16:39:11 UTC (rev 12727)
+++ trunk/wp-admin/includes/template.php        2010-01-15 16:58:36 UTC (rev 12728)
</span><span class="lines">@@ -748,22 +748,26 @@
</span><span class="cx">  *
</span><span class="cx">  * @return unknown
</span><span class="cx">  */
</span><del>-function wp_manage_posts_columns() {
-        global $typenow;
</del><ins>+function wp_manage_posts_columns( $screen = '') {
+        if ( empty($screen) )
+                $post_type = 'post';
+        else
+                $post_type = $screen-&gt;post_type;
</ins><span class="cx"> 
</span><span class="cx">         $posts_columns = array();
</span><span class="cx">         $posts_columns['cb'] = '&lt;input type=&quot;checkbox&quot; /&gt;';
</span><span class="cx">         /* translators: manage posts column name */
</span><del>-        $posts_columns['title'] = _x('Post', 'column name');
</del><ins>+        $posts_columns['title'] = _x('Title', 'column name');
</ins><span class="cx">         $posts_columns['author'] = __('Author');
</span><del>-        if ( empty($typenow) || is_object_in_taxonomy($typenow, 'category') )
</del><ins>+        if ( empty($post_type) || is_object_in_taxonomy($post_type, 'category') )
</ins><span class="cx">                 $posts_columns['categories'] = __('Categories');
</span><del>-        if ( empty($typenow) || is_object_in_taxonomy($typenow, 'category') )
</del><ins>+        if ( empty($post_type) || is_object_in_taxonomy($post_type, 'category') )
</ins><span class="cx">                 $posts_columns['tags'] = __('Tags');
</span><span class="cx">         $post_status = !empty($_REQUEST['post_status']) ? $_REQUEST['post_status'] : 'all';
</span><del>-        if ( !in_array( $post_status, array('pending', 'draft', 'future') ) &amp;&amp; ( empty($typenow) || post_type_supports($typenow, 'comments') ) )
</del><ins>+        if ( !in_array( $post_status, array('pending', 'draft', 'future') ) &amp;&amp; ( empty($post_type) || post_type_supports($post_type, 'comments') ) )
</ins><span class="cx">                 $posts_columns['comments'] = '&lt;div class=&quot;vers&quot;&gt;&lt;img alt=&quot;Comments&quot; src=&quot;images/comment-grey-bubble.png&quot; /&gt;&lt;/div&gt;';
</span><span class="cx">         $posts_columns['date'] = __('Date');
</span><ins>+        // @todo filter per type
</ins><span class="cx">         $posts_columns = apply_filters('manage_posts_columns', $posts_columns);
</span><span class="cx"> 
</span><span class="cx">         return $posts_columns;
</span><span class="lines">@@ -804,17 +808,7 @@
</span><span class="cx">  * @return unknown
</span><span class="cx">  */
</span><span class="cx"> function wp_manage_pages_columns() {
</span><del>-        $posts_columns = array();
-        $posts_columns['cb'] = '&lt;input type=&quot;checkbox&quot; /&gt;';
-        $posts_columns['title'] = __('Title');
-        $posts_columns['author'] = __('Author');
-        $post_status = !empty($_REQUEST['post_status']) ? $_REQUEST['post_status'] : 'all';
-        if ( !in_array( $post_status, array('pending', 'draft', 'future') ) )
-                $posts_columns['comments'] = '&lt;div class=&quot;vers&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;images/comment-grey-bubble.png&quot; /&gt;&lt;/div&gt;';
-        $posts_columns['date'] = __('Date');
-        $posts_columns = apply_filters('manage_pages_columns', $posts_columns);
-
-        return $posts_columns;
</del><ins>+        return wp_manage_posts_columns();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -822,33 +816,28 @@
</span><span class="cx">  *
</span><span class="cx">  * @since unknown
</span><span class="cx">  *
</span><del>- * @param unknown_type $page
</del><ins>+ * @param unknown_type $screen
</ins><span class="cx">  * @return unknown
</span><span class="cx">  */
</span><del>-function get_column_headers($page) {
</del><ins>+function get_column_headers($screen) {
</ins><span class="cx">         global $_wp_column_headers;
</span><span class="cx"> 
</span><span class="cx">         if ( !isset($_wp_column_headers) )
</span><span class="cx">                 $_wp_column_headers = array();
</span><span class="cx"> 
</span><del>-        $map_screen = $page;
-        $type = str_replace('edit-', '', $map_screen);
-        if ( in_array($type, get_post_types()) )
-                $map_screen = 'edit';
</del><ins>+        if ( is_string($screen) )
+                $screen = convert_to_screen($screen);
</ins><span class="cx"> 
</span><span class="cx">         // Store in static to avoid running filters on each call
</span><del>-        if ( isset($_wp_column_headers[$page]) )
-                return $_wp_column_headers[$page];
</del><ins>+        if ( isset($_wp_column_headers[$screen-&gt;id]) )
+                return $_wp_column_headers[$screen-&gt;id];
</ins><span class="cx"> 
</span><del>-        switch ($map_screen) {
</del><ins>+        switch ($screen-&gt;base) {
</ins><span class="cx">                 case 'edit':
</span><del>-                         $_wp_column_headers[$page] = wp_manage_posts_columns();
</del><ins>+                         $_wp_column_headers[$screen-&gt;id] = wp_manage_posts_columns( $screen );
</ins><span class="cx">                          break;
</span><del>-                case 'edit-pages':
-                        $_wp_column_headers[$page] = wp_manage_pages_columns();
-                        break;
</del><span class="cx">                 case 'edit-comments':
</span><del>-                        $_wp_column_headers[$page] = array(
</del><ins>+                        $_wp_column_headers[$screen-&gt;id] = array(
</ins><span class="cx">                                 'cb' =&gt; '&lt;input type=&quot;checkbox&quot; /&gt;',
</span><span class="cx">                                 'author' =&gt; __('Author'),
</span><span class="cx">                                 /* translators: column name */
</span><span class="lines">@@ -859,7 +848,7 @@
</span><span class="cx"> 
</span><span class="cx">                         break;
</span><span class="cx">                 case 'link-manager':
</span><del>-                        $_wp_column_headers[$page] = array(
</del><ins>+                        $_wp_column_headers[$screen-&gt;id] = array(
</ins><span class="cx">                                 'cb' =&gt; '&lt;input type=&quot;checkbox&quot; /&gt;',
</span><span class="cx">                                 'name' =&gt; __('Name'),
</span><span class="cx">                                 'url' =&gt; __('URL'),
</span><span class="lines">@@ -871,10 +860,10 @@
</span><span class="cx"> 
</span><span class="cx">                         break;
</span><span class="cx">                 case 'upload':
</span><del>-                        $_wp_column_headers[$page] = wp_manage_media_columns();
</del><ins>+                        $_wp_column_headers[$screen-&gt;id] = wp_manage_media_columns();
</ins><span class="cx">                         break;
</span><span class="cx">                 case 'categories':
</span><del>-                        $_wp_column_headers[$page] = array(
</del><ins>+                        $_wp_column_headers[$screen-&gt;id] = array(
</ins><span class="cx">                                 'cb' =&gt; '&lt;input type=&quot;checkbox&quot; /&gt;',
</span><span class="cx">                                 'name' =&gt; __('Name'),
</span><span class="cx">                                 'description' =&gt; __('Description'),
</span><span class="lines">@@ -884,7 +873,7 @@
</span><span class="cx"> 
</span><span class="cx">                         break;
</span><span class="cx">                 case 'edit-link-categories':
</span><del>-                        $_wp_column_headers[$page] = array(
</del><ins>+                        $_wp_column_headers[$screen-&gt;id] = array(
</ins><span class="cx">                                 'cb' =&gt; '&lt;input type=&quot;checkbox&quot; /&gt;',
</span><span class="cx">                                 'name' =&gt; __('Name'),
</span><span class="cx">                                 'description' =&gt; __('Description'),
</span><span class="lines">@@ -894,7 +883,7 @@
</span><span class="cx"> 
</span><span class="cx">                         break;
</span><span class="cx">                 case 'edit-tags':
</span><del>-                        $_wp_column_headers[$page] = array(
</del><ins>+                        $_wp_column_headers[$screen-&gt;id] = array(
</ins><span class="cx">                                 'cb' =&gt; '&lt;input type=&quot;checkbox&quot; /&gt;',
</span><span class="cx">                                 'name' =&gt; __('Name'),
</span><span class="cx">                                 'description' =&gt; __('Description'),
</span><span class="lines">@@ -904,7 +893,7 @@
</span><span class="cx"> 
</span><span class="cx">                         break;
</span><span class="cx">                 case 'users':
</span><del>-                        $_wp_column_headers[$page] = array(
</del><ins>+                        $_wp_column_headers[$screen-&gt;id] = array(
</ins><span class="cx">                                 'cb' =&gt; '&lt;input type=&quot;checkbox&quot; /&gt;',
</span><span class="cx">                                 'username' =&gt; __('Username'),
</span><span class="cx">                                 'name' =&gt; __('Name'),
</span><span class="lines">@@ -914,11 +903,11 @@
</span><span class="cx">                         );
</span><span class="cx">                         break;
</span><span class="cx">                 default :
</span><del>-                        $_wp_column_headers[$page] = array();
</del><ins>+                        $_wp_column_headers[$screen-&gt;id] = array();
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        $_wp_column_headers[$page] = apply_filters('manage_' . $page . '_columns', $_wp_column_headers[$page]);
-        return $_wp_column_headers[$page];
</del><ins>+        $_wp_column_headers[$screen-&gt;id] = apply_filters('manage_' . $screen-&gt;id . '_columns', $_wp_column_headers[$screen-&gt;id]);
+        return $_wp_column_headers[$screen-&gt;id];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -926,13 +915,15 @@
</span><span class="cx">  *
</span><span class="cx">  * @since unknown
</span><span class="cx">  *
</span><del>- * @param unknown_type $type
</del><ins>+ * @param unknown_type $screen
</ins><span class="cx">  * @param unknown_type $id
</span><span class="cx">  */
</span><del>-function print_column_headers( $type, $id = true ) {
-        $type = str_replace('.php', '', $type);
-        $columns = get_column_headers( $type );
-        $hidden = get_hidden_columns($type);
</del><ins>+function print_column_headers( $screen, $id = true ) {
+        if ( is_string($screen) )
+                $screen = convert_to_screen($screen);
+
+        $columns = get_column_headers( $screen );
+        $hidden = get_hidden_columns($screen);
</ins><span class="cx">         $styles = array();
</span><span class="cx"> 
</span><span class="cx">         foreach ( $columns as $column_key =&gt; $column_display_name ) {
</span><span class="lines">@@ -951,8 +942,8 @@
</span><span class="cx">                 if ( in_array($column_key, $hidden) )
</span><span class="cx">                         $style = 'display:none;';
</span><span class="cx"> 
</span><del>-                if ( isset($styles[$type]) &amp;&amp; isset($styles[$type][$column_key]) )
-                        $style .= ' ' . $styles[$type][$column_key];
</del><ins>+                if ( isset($styles[$screen-&gt;id]) &amp;&amp; isset($styles[$screen-&gt;id][$column_key]) )
+                        $style .= ' ' . $styles[$screen&gt;id][$column_key];
</ins><span class="cx">                 $style = ' style=&quot;' . $style . '&quot;';
</span><span class="cx"> ?&gt;
</span><span class="cx">         &lt;th scope=&quot;col&quot; &lt;?php echo $id ? &quot;id=\&quot;$column_key\&quot;&quot; : &quot;&quot;; echo $class; echo $style; ?&gt;&gt;&lt;?php echo $column_display_name; ?&gt;&lt;/th&gt;
</span><span class="lines">@@ -971,10 +962,13 @@
</span><span class="cx"> function register_column_headers($screen, $columns) {
</span><span class="cx">         global $_wp_column_headers;
</span><span class="cx"> 
</span><ins>+        if ( is_string($screen) )
+                $screen = convert_to_screen($screen);
+
</ins><span class="cx">         if ( !isset($_wp_column_headers) )
</span><span class="cx">                 $_wp_column_headers = array();
</span><span class="cx"> 
</span><del>-        $_wp_column_headers[$screen] = $columns;
</del><ins>+        $_wp_column_headers[$screen-&gt;id] = $columns;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -982,11 +976,13 @@
</span><span class="cx">  *
</span><span class="cx">  * @since unknown
</span><span class="cx">  *
</span><del>- * @param unknown_type $page
</del><ins>+ * @param unknown_type $screen
</ins><span class="cx">  */
</span><del>-function get_hidden_columns($page) {
-        $page = str_replace('.php', '', $page);
-        return (array) get_user_option( 'manage-' . $page . '-columns-hidden' );
</del><ins>+function get_hidden_columns($screen) {
+        if ( is_string($screen) )
+                $screen = convert_to_screen($screen);
+
+        return (array) get_user_option( 'manage-' . $screen-&gt;id. '-columns-hidden' );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -998,23 +994,23 @@
</span><span class="cx">  *
</span><span class="cx">  * @param string $type 'post' or 'page'
</span><span class="cx">  */
</span><del>-function inline_edit_row( $type ) {
</del><ins>+function inline_edit_row( $screen ) {
</ins><span class="cx">         global $current_user, $mode;
</span><span class="cx"> 
</span><del>-        $is_page = 'page' == $type;
-        if ( $is_page ) {
-                $screen = 'edit-pages';
-                $post = get_default_page_to_edit();
-        } else {
-                $screen = 'edit';
-                $post = get_default_post_to_edit();
</del><ins>+        if ( is_string($screen) ) {
+                $screen = array('id' =&gt; 'edit-' . $screen, 'base' =&gt; 'edit', 'post_type' =&gt; $screen );
+                $screen = (object) $screen;
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        $columns = $is_page ? wp_manage_pages_columns() : wp_manage_posts_columns();
</del><ins>+        $post = get_default_post_to_edit( $screen-&gt;post_type );
+        $post_type_object = get_post_type_object( $screen-&gt;post_type );
+
+        $columns = wp_manage_posts_columns($screen);
</ins><span class="cx">         $hidden = array_intersect( array_keys( $columns ), array_filter( get_hidden_columns($screen) ) );
</span><span class="cx">         $col_count = count($columns) - count($hidden);
</span><span class="cx">         $m = ( isset($mode) &amp;&amp; 'excerpt' == $mode ) ? 'excerpt' : 'list';
</span><del>-        $can_publish = current_user_can(&quot;publish_{$type}s&quot;);
</del><ins>+        // @todo use capability_type
+        $can_publish = current_user_can(&quot;publish_{$screen-&gt;post_type}s&quot;);
</ins><span class="cx">         $core_columns = array( 'cb' =&gt; true, 'date' =&gt; true, 'title' =&gt; true, 'categories' =&gt; true, 'tags' =&gt; true, 'comments' =&gt; true, 'author' =&gt; true );
</span><span class="cx"> 
</span><span class="cx"> ?&gt;
</span><span class="lines">@@ -1024,12 +1020,12 @@
</span><span class="cx">         $bulk = 0;
</span><span class="cx">         while ( $bulk &lt; 2 ) { ?&gt;
</span><span class="cx"> 
</span><del>-        &lt;tr id=&quot;&lt;?php echo $bulk ? 'bulk-edit' : 'inline-edit'; ?&gt;&quot; class=&quot;inline-edit-row inline-edit-row-&lt;?php echo &quot;$type &quot;;
-                echo $bulk ? &quot;bulk-edit-row bulk-edit-row-$type&quot; : &quot;quick-edit-row quick-edit-row-$type&quot;;
</del><ins>+        &lt;tr id=&quot;&lt;?php echo $bulk ? 'bulk-edit' : 'inline-edit'; ?&gt;&quot; class=&quot;inline-edit-row inline-edit-row-&lt;?php echo &quot;$screen-&gt;post_type &quot;;
+                echo $bulk ? &quot;bulk-edit-row bulk-edit-row-$screen-&gt;post_type&quot; : &quot;quick-edit-row quick-edit-row-$screen-&gt;post_type&quot;;
</ins><span class="cx">         ?&gt;&quot; style=&quot;display: none&quot;&gt;&lt;td colspan=&quot;&lt;?php echo $col_count; ?&gt;&quot;&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;fieldset class=&quot;inline-edit-col-left&quot;&gt;&lt;div class=&quot;inline-edit-col&quot;&gt;
</span><del>-                &lt;h4&gt;&lt;?php echo $bulk ? ( $is_page ? __( 'Bulk Edit Pages' ) : __( 'Bulk Edit Posts' ) ) : __( 'Quick Edit' ); ?&gt;&lt;/h4&gt;
</del><ins>+                &lt;h4&gt;&lt;?php echo $bulk ? ( __( 'Bulk Edit' ) ) : __( 'Quick Edit' ); ?&gt;&lt;/h4&gt;
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> &lt;?php if ( $bulk ) : ?&gt;
</span><span class="lines">@@ -1062,7 +1058,7 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;?php endif; // $bulk
</span><span class="cx"> 
</span><del>-                $authors = get_editable_user_ids( $current_user-&gt;id, true, $type ); // TODO: ROLE SYSTEM
</del><ins>+                $authors = get_editable_user_ids( $current_user-&gt;id, true, $screen-&gt;post_type ); // TODO: ROLE SYSTEM
</ins><span class="cx">                 $authors_dropdown = '';
</span><span class="cx">                 if ( $authors &amp;&amp; count( $authors ) &gt; 1 ) :
</span><span class="cx">                         $users_opt = array('include' =&gt; $authors, 'name' =&gt; 'post_author', 'class'=&gt; 'authors', 'multi' =&gt; 1, 'echo' =&gt; 0);
</span><span class="lines">@@ -1092,7 +1088,7 @@
</span><span class="cx">                         &lt;/em&gt;
</span><span class="cx">                         &lt;label class=&quot;alignleft inline-edit-private&quot;&gt;
</span><span class="cx">                                 &lt;input type=&quot;checkbox&quot; name=&quot;keep_private&quot; value=&quot;private&quot; /&gt;
</span><del>-                                &lt;span class=&quot;checkbox-title&quot;&gt;&lt;?php echo $is_page ? __('Private page') : __('Private post'); ?&gt;&lt;/span&gt;
</del><ins>+                                &lt;span class=&quot;checkbox-title&quot;&gt;&lt;?php echo __('Private'); ?&gt;&lt;/span&gt;
</ins><span class="cx">                         &lt;/label&gt;
</span><span class="cx">                 &lt;/div&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -1100,7 +1096,7 @@
</span><span class="cx"> 
</span><span class="cx">         &lt;/div&gt;&lt;/fieldset&gt;
</span><span class="cx"> 
</span><del>-&lt;?php if ( !$is_page &amp;&amp; !$bulk ) : ?&gt;
</del><ins>+&lt;?php if ( is_object_in_taxonomy($screen-&gt;post_type, 'categories') &amp;&amp; !$bulk ) : ?&gt;
</ins><span class="cx"> 
</span><span class="cx">         &lt;fieldset class=&quot;inline-edit-col-center inline-edit-categories&quot;&gt;&lt;div class=&quot;inline-edit-col&quot;&gt;
</span><span class="cx">                 &lt;span class=&quot;title inline-edit-categories-label&quot;&gt;&lt;?php _e( 'Categories' ); ?&gt;
</span><span class="lines">@@ -1112,7 +1108,7 @@
</span><span class="cx">                 &lt;/ul&gt;
</span><span class="cx">         &lt;/div&gt;&lt;/fieldset&gt;
</span><span class="cx"> 
</span><del>-&lt;?php endif; // !$is_page &amp;&amp; !$bulk ?&gt;
</del><ins>+&lt;?php endif; // !hierarchical &amp;&amp; !$bulk ?&gt;
</ins><span class="cx"> 
</span><span class="cx">         &lt;fieldset class=&quot;inline-edit-col-right&quot;&gt;&lt;div class=&quot;inline-edit-col&quot;&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -1121,7 +1117,7 @@
</span><span class="cx">                 echo $authors_dropdown;
</span><span class="cx"> ?&gt;
</span><span class="cx"> 
</span><del>-&lt;?php if ( $is_page ) : ?&gt;
</del><ins>+&lt;?php if ( $post_type_object-&gt;hierarchical ) : ?&gt;
</ins><span class="cx"> 
</span><span class="cx">                 &lt;label&gt;
</span><span class="cx">                         &lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Parent' ); ?&gt;&lt;/span&gt;
</span><span class="lines">@@ -1221,7 +1217,7 @@
</span><span class="cx">                                 &lt;/select&gt;
</span><span class="cx">                         &lt;/label&gt;
</span><span class="cx"> 
</span><del>-&lt;?php if ( !$is_page &amp;&amp; $can_publish &amp;&amp; current_user_can( 'edit_others_posts' ) ) : ?&gt;
</del><ins>+&lt;?php if ( 'post' == $screen-&gt;post_type &amp;&amp; $can_publish &amp;&amp; current_user_can( 'edit_others_posts' ) ) : ?&gt;
</ins><span class="cx"> 
</span><span class="cx"> &lt;?php        if ( $bulk ) : ?&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -1260,12 +1256,12 @@
</span><span class="cx">                 &lt;a accesskey=&quot;c&quot; href=&quot;#inline-edit&quot; title=&quot;&lt;?php _e('Cancel'); ?&gt;&quot; class=&quot;button-secondary cancel alignleft&quot;&gt;&lt;?php _e('Cancel'); ?&gt;&lt;/a&gt;
</span><span class="cx">                 &lt;?php if ( ! $bulk ) {
</span><span class="cx">                         wp_nonce_field( 'inlineeditnonce', '_inline_edit', false );
</span><del>-                        $update_text = ( $is_page ) ? __( 'Update Page' ) : __( 'Update Post' );
</del><ins>+                        $update_text = __( 'Update' );
</ins><span class="cx">                         ?&gt;
</span><span class="cx">                         &lt;a accesskey=&quot;s&quot; href=&quot;#inline-edit&quot; title=&quot;&lt;?php _e('Update'); ?&gt;&quot; class=&quot;button-primary save alignright&quot;&gt;&lt;?php echo esc_attr( $update_text ); ?&gt;&lt;/a&gt;
</span><span class="cx">                         &lt;img class=&quot;waiting&quot; style=&quot;display:none;&quot; src=&quot;images/wpspin_light.gif&quot; alt=&quot;&quot; /&gt;
</span><span class="cx">                 &lt;?php } else {
</span><del>-                        $update_text = ( $is_page ) ? __( 'Update Pages' ) : __( 'Update Posts' );
</del><ins>+                        $update_text = __( 'Update' );
</ins><span class="cx">                 ?&gt;
</span><span class="cx">                         &lt;input accesskey=&quot;s&quot; class=&quot;button-primary alignright&quot; type=&quot;submit&quot; name=&quot;bulk_edit&quot; value=&quot;&lt;?php echo esc_attr( $update_text ); ?&gt;&quot; /&gt;
</span><span class="cx">                 &lt;?php } ?&gt;
</span><span class="lines">@@ -1369,7 +1365,7 @@
</span><span class="cx">  * @param unknown_type $mode
</span><span class="cx">  */
</span><span class="cx"> function _post_row($a_post, $pending_comments, $mode) {
</span><del>-        global $post, $current_user;
</del><ins>+        global $post, $current_user, $current_screen;
</ins><span class="cx">         static $rowclass;
</span><span class="cx"> 
</span><span class="cx">         $global_post = $post;
</span><span class="lines">@@ -1383,8 +1379,8 @@
</span><span class="cx"> ?&gt;
</span><span class="cx">         &lt;tr id='post-&lt;?php echo $post-&gt;ID; ?&gt;' class='&lt;?php echo trim( $rowclass . ' author-' . $post_owner . ' status-' . $post-&gt;post_status ); ?&gt; iedit' valign=&quot;top&quot;&gt;
</span><span class="cx"> &lt;?php
</span><del>-        $posts_columns = get_column_headers('edit');
-        $hidden = get_hidden_columns('edit');
</del><ins>+        $posts_columns = get_column_headers( $current_screen );
+        $hidden = get_hidden_columns( $current_screen );
</ins><span class="cx">         foreach ( $posts_columns as $column_name=&gt;$column_display_name ) {
</span><span class="cx">                 $class = &quot;class=\&quot;$column_name column-$column_name\&quot;&quot;;
</span><span class="cx"> 
</span><span class="lines">@@ -1579,7 +1575,7 @@
</span><span class="cx">  * @param unknown_type $level
</span><span class="cx">  */
</span><span class="cx"> function display_page_row( $page, $level = 0 ) {
</span><del>-        global $post;
</del><ins>+        global $post, $current_screen;
</ins><span class="cx">         static $rowclass;
</span><span class="cx"> 
</span><span class="cx">         $post = $page;
</span><span class="lines">@@ -1606,8 +1602,8 @@
</span><span class="cx">         $pad = str_repeat( '&amp;#8212; ', $level );
</span><span class="cx">         $id = (int) $page-&gt;ID;
</span><span class="cx">         $rowclass = 'alternate' == $rowclass ? '' : 'alternate';
</span><del>-        $posts_columns = get_column_headers('edit-pages');
-        $hidden = get_hidden_columns('edit-pages');
</del><ins>+        $posts_columns = get_column_headers( $current_screen );
+        $hidden = get_hidden_columns(  $current_screen );
</ins><span class="cx">         $title = _draft_or_post_title();
</span><span class="cx"> ?&gt;
</span><span class="cx"> &lt;tr id=&quot;page-&lt;?php echo $id; ?&gt;&quot; class=&quot;&lt;?php echo $rowclass; ?&gt; iedit&quot;&gt;
</span><span class="lines">@@ -3056,19 +3052,22 @@
</span><span class="cx">  *
</span><span class="cx">  * @since unknown
</span><span class="cx">  *
</span><del>- * @param unknown_type $page
</del><ins>+ * @param unknown_type $screen
</ins><span class="cx">  */
</span><del>-function meta_box_prefs($page) {
</del><ins>+function meta_box_prefs($screen) {
</ins><span class="cx">         global $wp_meta_boxes;
</span><span class="cx"> 
</span><del>-        if ( empty($wp_meta_boxes[$page]) )
</del><ins>+        if ( is_string($screen) )
+                $screen = convert_to_screen($screen);
+
+        if ( empty($wp_meta_boxes[$screen-&gt;id]) )
</ins><span class="cx">                 return;
</span><span class="cx"> 
</span><del>-        $hidden = get_hidden_meta_boxes($page);
</del><ins>+        $hidden = get_hidden_meta_boxes($screen);
</ins><span class="cx"> 
</span><del>-        foreach ( array_keys($wp_meta_boxes[$page]) as $context ) {
-                foreach ( array_keys($wp_meta_boxes[$page][$context]) as $priority ) {
-                        foreach ( $wp_meta_boxes[$page][$context][$priority] as $box ) {
</del><ins>+        foreach ( array_keys($wp_meta_boxes[$screen-&gt;id]) as $context ) {
+                foreach ( array_keys($wp_meta_boxes[$screen-&gt;id][$context]) as $priority ) {
+                        foreach ( $wp_meta_boxes[$screen-&gt;id][$context][$priority] as $box ) {
</ins><span class="cx">                                 if ( false == $box || ! $box['title'] )
</span><span class="cx">                                         continue;
</span><span class="cx">                                 // Submit box cannot be hidden
</span><span class="lines">@@ -3083,9 +3082,12 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-function get_hidden_meta_boxes($page) {
-        $hidden = (array) get_user_option( &quot;meta-box-hidden_$page&quot; );
</del><ins>+function get_hidden_meta_boxes($screen) {
+        if ( is_string($screen) )
+                $screen = convert_to_screen($screen);
</ins><span class="cx"> 
</span><ins>+        $hidden = (array) get_user_option( &quot;meta-box-hidden_$screen-&gt;id&quot; );
+
</ins><span class="cx">         // Hide slug boxes by default
</span><span class="cx">         if ( empty($hidden[0]) ) {
</span><span class="cx">                 $hidden = array('slugdiv');
</span><span class="lines">@@ -3279,44 +3281,47 @@
</span><span class="cx">  * @since unknown
</span><span class="cx">  */
</span><span class="cx"> function favorite_actions( $screen = null ) {
</span><del>-        switch ( $screen ) {
-                case 'post-new.php':
</del><ins>+        if ( is_string($screen) )
+                $screen = convert_to_screen($screen);
+
+        switch ( $screen-&gt;id ) {
+                case 'post':
</ins><span class="cx">                         $default_action = array('edit.php' =&gt; array(__('Edit Posts'), 'edit_posts'));
</span><span class="cx">                         break;
</span><del>-                case 'edit-pages.php':
-                        $default_action = array('page-new.php' =&gt; array(__('New Page'), 'edit_pages'));
</del><ins>+                case 'edit-page':
+                        $default_action = array('post-new.php?post_type=page' =&gt; array(__('New Page'), 'edit_pages'));
</ins><span class="cx">                         break;
</span><del>-                case 'page-new.php':
-                        $default_action = array('edit-pages.php' =&gt; array(__('Edit Pages'), 'edit_pages'));
</del><ins>+                case 'page':
+                        $default_action = array('edit.php?post_type=page' =&gt; array(__('Edit Pages'), 'edit_pages'));
</ins><span class="cx">                         break;
</span><span class="cx">                 case 'upload.php':
</span><span class="cx">                         $default_action = array('media-new.php' =&gt; array(__('New Media'), 'upload_files'));
</span><span class="cx">                         break;
</span><del>-                case 'media-new.php':
</del><ins>+                case 'media':
</ins><span class="cx">                         $default_action = array('upload.php' =&gt; array(__('Edit Media'), 'upload_files'));
</span><span class="cx">                         break;
</span><del>-                case 'link-manager.php':
</del><ins>+                case 'link-manager':
</ins><span class="cx">                         $default_action = array('link-add.php' =&gt; array(__('New Link'), 'manage_links'));
</span><span class="cx">                         break;
</span><del>-                case 'link-add.php':
</del><ins>+                case 'link-add':
</ins><span class="cx">                         $default_action = array('link-manager.php' =&gt; array(__('Edit Links'), 'manage_links'));
</span><span class="cx">                         break;
</span><del>-                case 'users.php':
</del><ins>+                case 'users':
</ins><span class="cx">                         $default_action = array('user-new.php' =&gt; array(__('New User'), 'create_users'));
</span><span class="cx">                         break;
</span><del>-                case 'user-new.php':
</del><ins>+                case 'user':
</ins><span class="cx">                         $default_action = array('users.php' =&gt; array(__('Edit Users'), 'edit_users'));
</span><span class="cx">                         break;
</span><del>-                case 'plugins.php':
</del><ins>+                case 'plugins':
</ins><span class="cx">                         $default_action = array('plugin-install.php' =&gt; array(__('Install Plugins'), 'install_plugins'));
</span><span class="cx">                         break;
</span><del>-                case 'plugin-install.php':
</del><ins>+                case 'plugin-install':
</ins><span class="cx">                         $default_action = array('plugins.php' =&gt; array(__('Manage Plugins'), 'activate_plugins'));
</span><span class="cx">                         break;
</span><del>-                case 'themes.php':
</del><ins>+                case 'themes':
</ins><span class="cx">                         $default_action = array('theme-install.php' =&gt; array(__('Install Themes'), 'install_themes'));
</span><span class="cx">                         break;
</span><del>-                case 'theme-install.php':
</del><ins>+                case 'theme-install':
</ins><span class="cx">                         $default_action = array('themes.php' =&gt; array(__('Manage Themes'), 'switch_themes'));
</span><span class="cx">                         break;
</span><span class="cx">                 default:
</span><span class="lines">@@ -3484,32 +3489,34 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-function screen_meta($screen) {
-        global $wp_meta_boxes, $_wp_contextual_help, $typenow;
-
</del><ins>+// Convert a screen string to a screen object
+function convert_to_screen( $screen ) {
</ins><span class="cx">         $screen = str_replace('.php', '', $screen);
</span><span class="cx">         $screen = str_replace('-new', '', $screen);
</span><span class="cx">         $screen = str_replace('-add', '', $screen);
</span><span class="cx">         $screen = apply_filters('screen_meta_screen', $screen);
</span><span class="cx"> 
</span><ins>+        $screen = array('id' =&gt; $screen, 'base' =&gt; $screen);
+        return (object) $screen;
+}
+
+function screen_meta($screen) {
+        global $wp_meta_boxes, $_wp_contextual_help, $post_type;
+
+        if ( is_string($screen) )
+                $screen = convert_to_screen($screen);
+
</ins><span class="cx">         $column_screens = get_column_headers($screen);
</span><span class="cx">         $meta_screens = array('index' =&gt; 'dashboard');
</span><span class="cx"> 
</span><del>-        // Give post_type pages their own screen
-        if ( 'post' == $screen ) {
-                if ( !empty($typenow) )
-                        $screen = $typenow;
</del><ins>+        if ( isset($meta_screens[$screen-&gt;id]) ) {
+                $screen-&gt;id = $meta_screens[$screen-&gt;id];
+                $screen-&gt;base = $screen-&gt;id;
</ins><span class="cx">         }
</span><del>-        if ( 'edit' == $screen ) {
-                if ( !empty($typenow) )
-                        $screen = 'edit-' . $typenow;
-        }
</del><span class="cx"> 
</span><del>-        if ( isset($meta_screens[$screen]) )
-                $screen = $meta_screens[$screen];
</del><span class="cx">         $show_screen = false;
</span><span class="cx">         $show_on_screen = false;
</span><del>-        if ( !empty($wp_meta_boxes[$screen]) || !empty($column_screens) ) {
</del><ins>+        if ( !empty($wp_meta_boxes[$screen-&gt;id]) || !empty($column_screens) ) {
</ins><span class="cx">                 $show_screen = true;
</span><span class="cx">                 $show_on_screen = true;
</span><span class="cx">         }
</span><span class="lines">@@ -3523,49 +3530,8 @@
</span><span class="cx"> 
</span><span class="cx">         $settings = '';
</span><span class="cx"> 
</span><del>-        switch ( $screen ) {
-                case 'post':
-                        if ( !isset($_wp_contextual_help['post']) ) {
-                                $help = drag_drop_help();
-                                $help .= '&lt;p&gt;' . __('&lt;a href=&quot;http://codex.wordpress.org/Writing_Posts&quot; target=&quot;_blank&quot;&gt;Writing Posts&lt;/a&gt;') . '&lt;/p&gt;';
-                                $_wp_contextual_help['post'] = $help;
-                        }
-                        break;
-                case 'page':
-                        if ( !isset($_wp_contextual_help['page']) ) {
-                                $help = drag_drop_help();
-                                $_wp_contextual_help['page'] = $help;
-                        }
-                        break;
-                case 'dashboard':
-                        if ( !isset($_wp_contextual_help['dashboard']) ) {
-                                $help = '&lt;p&gt;' . __('The modules on this screen can be arranged in several columns. You can select the number of columns from the Screen Options tab.') . &quot;&lt;/p&gt;\n&quot;;
-                                $help .= drag_drop_help();
-                                $_wp_contextual_help['dashboard'] = $help;
-                        }
-                        break;
-                case 'link':
-                        if ( !isset($_wp_contextual_help['link']) ) {
-                                $help = drag_drop_help();
-                                $_wp_contextual_help['link'] = $help;
-                        }
-                        break;
-                case 'options-general':
-                        if ( !isset($_wp_contextual_help['options-general']) )
-                                $_wp_contextual_help['options-general'] = __('&lt;a href=&quot;http://codex.wordpress.org/Settings_General_SubPanel&quot; target=&quot;_blank&quot;&gt;General Settings&lt;/a&gt;');
-                        break;
-                case 'theme-install':
-                case 'plugin-install':
-                        if ( ( !isset($_GET['tab']) || 'dashboard' == $_GET['tab'] ) &amp;&amp; !isset($_wp_contextual_help[$screen]) ) {
-                                $help = plugins_search_help();
-                                $_wp_contextual_help[$screen] = $help;
-                        }
-                        break;
</del><ins>+        switch ( $screen-&gt;id ) {
</ins><span class="cx">                 case 'widgets':
</span><del>-                        if ( !isset($_wp_contextual_help['widgets']) ) {
-                                $help = widgets_help();
-                                $_wp_contextual_help['widgets'] = $help;
-                        }
</del><span class="cx">                         $settings = '&lt;p&gt;&lt;a id=&quot;access-on&quot; href=&quot;widgets.php?widgets-access=on&quot;&gt;' . __('Enable accessibility mode') . '&lt;/a&gt;&lt;a id=&quot;access-off&quot; href=&quot;widgets.php?widgets-access=off&quot;&gt;' . __('Disable accessibility mode') . &quot;&lt;/a&gt;&lt;/p&gt;\n&quot;;
</span><span class="cx">                         $show_screen = true;
</span><span class="cx">                         break;
</span><span class="lines">@@ -3605,12 +3571,12 @@
</span><span class="cx">         &lt;div id=&quot;contextual-help-wrap&quot; class=&quot;hidden&quot;&gt;
</span><span class="cx">         &lt;?php
</span><span class="cx">         $contextual_help = '';
</span><del>-        if ( isset($_wp_contextual_help[$screen]) ) {
</del><ins>+        if ( isset($_wp_contextual_help[$screen-&gt;id]) ) {
</ins><span class="cx">                 if ( !empty($title) )
</span><span class="cx">                         $contextual_help .= '&lt;h5&gt;' . sprintf(__('Get help with &amp;#8220;%s&amp;#8221;'), $title) . '&lt;/h5&gt;';
</span><span class="cx">                 else
</span><span class="cx">                         $contextual_help .= '&lt;h5&gt;' . __('Get help with this page') . '&lt;/h5&gt;';
</span><del>-                $contextual_help .= '&lt;div class=&quot;metabox-prefs&quot;&gt;' . $_wp_contextual_help[$screen] . &quot;&lt;/div&gt;\n&quot;;
</del><ins>+                $contextual_help .= '&lt;div class=&quot;metabox-prefs&quot;&gt;' . $_wp_contextual_help[$screen-&gt;id] . &quot;&lt;/div&gt;\n&quot;;
</ins><span class="cx"> 
</span><span class="cx">                 $contextual_help .= '&lt;h5&gt;' . __('Other Help') . '&lt;/h5&gt;';
</span><span class="cx">         } else {
</span><span class="lines">@@ -3652,10 +3618,13 @@
</span><span class="cx"> function add_contextual_help($screen, $help) {
</span><span class="cx">         global $_wp_contextual_help;
</span><span class="cx"> 
</span><ins>+        if ( is_string($screen) )
+                $screen = convert_to_screen($screen);
+
</ins><span class="cx">         if ( !isset($_wp_contextual_help) )
</span><span class="cx">                 $_wp_contextual_help = array();
</span><span class="cx"> 
</span><del>-        $_wp_contextual_help[$screen] = $help;
</del><ins>+        $_wp_contextual_help[$screen-&gt;id] = $help;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function drag_drop_help() {
</span><span class="lines">@@ -3675,33 +3644,27 @@
</span><span class="cx"> ';
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-function widgets_help() {
-        return '
-        &lt;p&gt;' . __('Widgets are added and arranged by simple drag &amp;#8217;n&amp;#8217; drop. If you hover your mouse over the titlebar of a widget, you&amp;#8217;ll see a 4-arrow cursor which indicates that the widget is movable.  Click on the titlebar, hold down the mouse button and drag the widget to a sidebar. As you drag, you&amp;#8217;ll see a dotted box that also moves. This box shows where the widget will go once you drop it.') . '&lt;/p&gt;
-        &lt;p&gt;' . __('To remove a widget from a sidebar, drag it back to Available Widgets or click on the arrow on its titlebar to reveal its settings, and then click Remove.') . '&lt;/p&gt;
-        &lt;p&gt;' . __('To remove a widget from a sidebar &lt;em&gt;and keep its configuration&lt;/em&gt;, drag it to Inactive Widgets.') . '&lt;/p&gt;
-        &lt;p&gt;' . __('The Inactive Widgets area stores widgets that are configured but not curently used. If you change themes and the new theme has fewer sidebars than the old, all extra widgets will be stored to Inactive Widgets automatically.') . '&lt;/p&gt;
-';
-}
-
</del><span class="cx"> function screen_layout($screen) {
</span><span class="cx">         global $screen_layout_columns;
</span><span class="cx"> 
</span><ins>+        if ( is_string($screen) )
+                $screen = convert_to_screen($screen);
+
</ins><span class="cx">         $columns = array('dashboard' =&gt; 4, 'post' =&gt; 2, 'page' =&gt; 2, 'link' =&gt; 2);
</span><span class="cx"> 
</span><span class="cx">         // Add custom post types
</span><span class="cx">         foreach ( get_post_types( array('_show' =&gt; true) ) as $post_type )
</span><span class="cx">                 $columns[$post_type] = 2;
</span><span class="cx"> 
</span><del>-        $columns = apply_filters('screen_layout_columns', $columns, $screen);
</del><ins>+        $columns = apply_filters('screen_layout_columns', $columns, $screen-&gt;id, $screen);
</ins><span class="cx"> 
</span><del>-        if ( !isset($columns[$screen]) ) {
</del><ins>+        if ( !isset($columns[$screen-&gt;id]) ) {
</ins><span class="cx">                 $screen_layout_columns = 0;
</span><span class="cx">                 return '';
</span><span class="cx">          }
</span><span class="cx"> 
</span><del>-        $screen_layout_columns = get_user_option(&quot;screen_layout_$screen&quot;);
-        $num = $columns[$screen];
</del><ins>+        $screen_layout_columns = get_user_option(&quot;screen_layout_$screen-&gt;id&quot;);
+        $num = $columns[$screen-&gt;id];
</ins><span class="cx"> 
</span><span class="cx">         if ( ! $screen_layout_columns )
</span><span class="cx">                         $screen_layout_columns = 2;
</span><span class="lines">@@ -3717,12 +3680,10 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function screen_options($screen) {
</span><del>-        $map_screen = $screen;
-        $type = str_replace('edit-', '', $map_screen);
-        if ( in_array($type, get_post_types()) )
-                $map_screen = 'edit';
</del><ins>+        if ( is_string($screen) )
+                $screen = convert_to_screen($screen);
</ins><span class="cx"> 
</span><del>-        switch ( $map_screen ) {
</del><ins>+        switch ( $screen-&gt;base ) {
</ins><span class="cx">                 case 'edit':
</span><span class="cx">                         $per_page_label = __('Posts per page:');
</span><span class="cx">                         break;
</span><span class="lines">@@ -3748,10 +3709,10 @@
</span><span class="cx">                         return '';
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        $option = str_replace( '-', '_', &quot;${screen}_per_page&quot; );
</del><ins>+        $option = str_replace( '-', '_', &quot;{$screen-&gt;id}_per_page&quot; );
</ins><span class="cx">         $per_page = (int) get_user_option( $option );
</span><span class="cx">         if ( empty( $per_page ) || $per_page &lt; 1 ) {
</span><del>-                if ( 'plugins' == $screen )
</del><ins>+                if ( 'plugins' == $screen-&gt;id )
</ins><span class="cx">                         $per_page = 999;
</span><span class="cx">                 else
</span><span class="cx">                         $per_page = 20;
</span><span class="lines">@@ -3773,18 +3734,19 @@
</span><span class="cx">         return $return;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-function screen_icon($name = '') {
-        global $parent_file, $hook_suffix;
</del><ins>+function screen_icon($screen = '') {
+        global $current_screen;
</ins><span class="cx"> 
</span><ins>+        if ( empty($screen) )
+                $screen = $current_screen;
+        elseif ( is_string($screen) )
+                $name = $screen;
+
</ins><span class="cx">         if ( empty($name) ) {
</span><del>-                if ( isset($parent_file) &amp;&amp; !empty($parent_file) ) {
-                        $name = $parent_file;
-                        if ( false !== $pos = strpos($name, '?post_type=') )
-                                $name = substr($name, 0, $pos);
-                        $name = substr($name, 0, -4);
-                }
</del><ins>+                if ( !empty($screen-&gt;parent_base) )
+                        $name = $screen-&gt;parent_base;
</ins><span class="cx">                 else
</span><del>-                        $name = str_replace(array('.php', '-new', '-add'), '', $hook_suffix);
</del><ins>+                        $name = $screen-&gt;base;
</ins><span class="cx">         }
</span><span class="cx"> ?&gt;
</span><span class="cx">         &lt;div id=&quot;icon-&lt;?php echo $name; ?&gt;&quot; class=&quot;icon32&quot;&gt;&lt;br /&gt;&lt;/div&gt;
</span></span></pre></div>
<a id="trunkwpadminindexphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/index.php (12727 => 12728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/index.php        2010-01-15 16:39:11 UTC (rev 12727)
+++ trunk/wp-admin/index.php        2010-01-15 16:58:36 UTC (rev 12728)
</span><span class="lines">@@ -23,6 +23,9 @@
</span><span class="cx"> 
</span><span class="cx"> $title = __('Dashboard');
</span><span class="cx"> $parent_file = 'index.php';
</span><ins>+
+add_contextual_help($current_screen, '&lt;p&gt;' . __('The modules on this screen can be arranged in several columns. You can select the number of columns from the Screen Options tab.') . &quot;&lt;/p&gt;\n&quot; . drag_drop_help() );
+
</ins><span class="cx"> require_once('admin-header.php');
</span><span class="cx"> 
</span><span class="cx"> $today = current_time('mysql', 1);
</span></span></pre></div>
<a id="trunkwpadminmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/menu.php (12727 => 12728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/menu.php        2010-01-15 16:39:11 UTC (rev 12727)
+++ trunk/wp-admin/menu.php        2010-01-15 16:58:36 UTC (rev 12728)
</span><span class="lines">@@ -68,10 +68,10 @@
</span><span class="cx">         $submenu['link-manager.php'][10] = array( _x('Add New', 'links'), 'manage_links', 'link-add.php' );
</span><span class="cx">         $submenu['link-manager.php'][15] = array( __('Link Categories'), 'manage_categories', 'edit-link-categories.php' );
</span><span class="cx"> 
</span><del>-$menu[20] = array( __('Pages'), 'edit_pages', 'edit-pages.php', '', 'menu-top', 'menu-pages', 'div' );
-        $submenu['edit-pages.php'][5] = array( __('Edit'), 'edit_pages', 'edit-pages.php' );
</del><ins>+$menu[20] = array( __('Pages'), 'edit_pages', 'edit.php?post_type=page', '', 'menu-top', 'menu-pages', 'div' );
+        $submenu['edit.php?post_type=page'][5] = array( __('Edit'), 'edit_pages', 'edit.php?post_type=page' );
</ins><span class="cx">         /* translators: add new page */
</span><del>-        $submenu['edit-pages.php'][10] = array( _x('Add New', 'page'), 'edit_pages', 'post-new.php?post_type=page' );
</del><ins>+        $submenu['edit.php?post_type=page'][10] = array( _x('Add New', 'page'), 'edit_pages', 'post-new.php?post_type=page' );
</ins><span class="cx"> 
</span><span class="cx"> $menu[25] = array( sprintf( __('Comments %s'), &quot;&lt;span id='awaiting-mod' class='count-$awaiting_mod'&gt;&lt;span class='pending-count'&gt;&quot; . number_format_i18n($awaiting_mod) . &quot;&lt;/span&gt;&lt;/span&gt;&quot; ), 'edit_posts', 'edit-comments.php', '', 'menu-top', 'menu-comments', 'div' );
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminoptionsgeneralphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/options-general.php (12727 => 12728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/options-general.php        2010-01-15 16:39:11 UTC (rev 12727)
+++ trunk/wp-admin/options-general.php        2010-01-15 16:58:36 UTC (rev 12728)
</span><span class="lines">@@ -50,6 +50,8 @@
</span><span class="cx"> }
</span><span class="cx"> add_filter('admin_head', 'add_js');
</span><span class="cx"> 
</span><ins>+add_contextual_help($current_screen, __('&lt;a href=&quot;http://codex.wordpress.org/Settings_General_SubPanel&quot; target=&quot;_blank&quot;&gt;General Settings&lt;/a&gt;'));
+
</ins><span class="cx"> include('./admin-header.php');
</span><span class="cx"> ?&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminplugininstallphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/plugin-install.php (12727 => 12728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/plugin-install.php        2010-01-15 16:39:11 UTC (rev 12727)
+++ trunk/wp-admin/plugin-install.php        2010-01-15 16:58:36 UTC (rev 12728)
</span><span class="lines">@@ -52,6 +52,8 @@
</span><span class="cx"> 
</span><span class="cx"> do_action('install_plugins_pre_' . $tab); //Used to override the general interface, Eg, install or plugin information.
</span><span class="cx"> 
</span><ins>+add_contextual_help($current_screen, plugins_search_help());
+
</ins><span class="cx"> include('admin-header.php');
</span><span class="cx"> ?&gt;
</span><span class="cx"> &lt;div class=&quot;wrap&quot;&gt;
</span></span></pre></div>
<a id="trunkwpadminpluginsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/plugins.php (12727 => 12728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/plugins.php        2010-01-15 16:39:11 UTC (rev 12727)
+++ trunk/wp-admin/plugins.php        2010-01-15 16:58:36 UTC (rev 12728)
</span><span class="lines">@@ -236,7 +236,7 @@
</span><span class="cx"> $help .= '&lt;p&gt;' . sprintf(__('You can find additional plugins for your site by using the new &lt;a href=&quot;%1$s&quot;&gt;Plugin Browser/Installer&lt;/a&gt; functionality or by browsing the &lt;a href=&quot;http://wordpress.org/extend/plugins/&quot;&gt;WordPress Plugin Directory&lt;/a&gt; directly and installing manually.  To &lt;em&gt;manually&lt;/em&gt; install a plugin you generally just need to upload the plugin file into your &lt;code&gt;%2$s&lt;/code&gt; directory.  Once a plugin has been installed, you may activate it here.'), 'plugin-install.php', WP_PLUGIN_DIR) . '&lt;/p&gt;';
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-add_contextual_help('plugins', $help);
</del><ins>+add_contextual_help($current_screen, $help);
</ins><span class="cx"> 
</span><span class="cx"> if ( is_multisite() &amp;&amp; is_super_admin() ) {
</span><span class="cx">         $menu_perms = get_site_option('menu_items', array());
</span></span></pre></div>
<a id="trunkwpadminpostnewphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/post-new.php (12727 => 12728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/post-new.php        2010-01-15 16:39:11 UTC (rev 12727)
+++ trunk/wp-admin/post-new.php        2010-01-15 16:58:36 UTC (rev 12728)
</span><span class="lines">@@ -17,8 +17,6 @@
</span><span class="cx"> if ( 'post' != $post_type ) {
</span><span class="cx">         $parent_file = &quot;edit.php?post_type=$post_type&quot;;
</span><span class="cx">         $submenu_file = &quot;post-new.php?post_type=$post_type&quot;;
</span><del>-        if ( 'page' == $post_type )
-                $parent_file = 'edit-pages.php';
</del><span class="cx"> } else {
</span><span class="cx">         $parent_file = 'edit.php';
</span><span class="cx">         $submenu_file = 'post-new.php';
</span></span></pre></div>
<a id="trunkwpadminpostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/post.php (12727 => 12728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/post.php        2010-01-15 16:39:11 UTC (rev 12727)
+++ trunk/wp-admin/post.php        2010-01-15 16:58:36 UTC (rev 12728)
</span><span class="lines">@@ -23,17 +23,29 @@
</span><span class="cx"> else
</span><span class="cx">         $post_id = 0;
</span><span class="cx"> $post_ID = $post_id;
</span><del>-
</del><span class="cx"> $post = null;
</span><span class="cx"> $post_type_object = null;
</span><span class="cx"> $post_type_cap = null;
</span><ins>+$post_type = null;
</ins><span class="cx"> if ( $post_id ) {
</span><span class="cx">         $post = get_post($post_id);
</span><span class="cx">         if ( $post ) {
</span><span class="cx">                 $post_type_object = get_post_type_object($post-&gt;post_type);
</span><del>-                if ( $post_type_object )
</del><ins>+                if ( $post_type_object ) {
+                        $post_type = $post-&gt;post_type;
+                        $current_screen-&gt;post_type = $post-&gt;post_type;
+                        $current_screen-&gt;id = $current_screen-&gt;post_type;
</ins><span class="cx">                         $post_type_cap = $post_type_object-&gt;capability_type;
</span><ins>+                }
</ins><span class="cx">         }
</span><ins>+} elseif ( isset($_POST['post_type']) ) {
+        $post_type_object = get_post_type_object($_POST['post_type']);
+        if ( $post_type_object ) {
+                $post_type = $post_type_object-&gt;name;
+                $current_screen-&gt;post_type = $post_type;
+                $current_screen-&gt;id = $current_screen-&gt;post_type;
+                $post_type_cap = $post_type_object-&gt;capability_type;
+        }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -108,7 +120,7 @@
</span><span class="cx"> case 'post':
</span><span class="cx"> case 'post-quickpress-publish':
</span><span class="cx"> case 'post-quickpress-save':
</span><del>-        check_admin_referer('add-post');
</del><ins>+        check_admin_referer('add-' . $post_type);
</ins><span class="cx"> 
</span><span class="cx">         if ( 'post-quickpress-publish' == $action )
</span><span class="cx">                 $_POST['publish'] = 'publish'; // tell write_post() to publish
</span><span class="lines">@@ -163,17 +175,9 @@
</span><span class="cx">         if ( 'post' == $post_type ) {
</span><span class="cx">                 $parent_file = &quot;edit.php&quot;;
</span><span class="cx">                 $submenu_file = &quot;edit.php&quot;;
</span><del>-        } elseif ( 'page' == $post_type ) {
-                $parent_file = &quot;edit-pages.php&quot;;
-                $submenu_file = &quot;edit-pages.php&quot;;
</del><span class="cx">         } else {
</span><del>-                if ( $post_type_object-&gt;hierarchical ) {
-                        $parent_file = &quot;edit-pages.php?post_type=$post_type&quot;;
-                        $submenu_file = &quot;edit-pages.php?post_type=$post_type&quot;;
-                } else {
-                        $parent_file = &quot;edit.php?post_type=$post_type&quot;;
-                        $submenu_file = &quot;edit.php?post_type=$post_type&quot;;
-                }
</del><ins>+                $parent_file = &quot;edit.php?post_type=$post_type&quot;;
+                $submenu_file = &quot;edit.php?post_type=$post_type&quot;;
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         wp_enqueue_script('post');
</span><span class="lines">@@ -213,7 +217,7 @@
</span><span class="cx">         wp_update_attachment_metadata( $post_id, $newmeta );
</span><span class="cx"> 
</span><span class="cx"> case 'editpost':
</span><del>-        check_admin_referer('update-' . $post-&gt;post_type . '_' . $post_id);
</del><ins>+        check_admin_referer('update-' . $post_type . '_' . $post_id);
</ins><span class="cx"> 
</span><span class="cx">         $post_id = edit_post();
</span><span class="cx"> 
</span><span class="lines">@@ -223,7 +227,7 @@
</span><span class="cx">         break;
</span><span class="cx"> 
</span><span class="cx"> case 'trash':
</span><del>-        check_admin_referer('trash-post_' . $post_id);
</del><ins>+        check_admin_referer('trash-' . $post_type . '_' . $post_id);
</ins><span class="cx"> 
</span><span class="cx">         $post = &amp; get_post($post_id);
</span><span class="cx"> 
</span><span class="lines">@@ -238,7 +242,7 @@
</span><span class="cx">         break;
</span><span class="cx"> 
</span><span class="cx"> case 'untrash':
</span><del>-        check_admin_referer('untrash-post_' . $post_id);
</del><ins>+        check_admin_referer('untrash-' . $post_type . '_' . $post_id);
</ins><span class="cx"> 
</span><span class="cx">         if ( !current_user_can('delete_' . $post_type_cap, $post_id) )
</span><span class="cx">                 wp_die( __('You are not allowed to move this item out of the trash.') );
</span><span class="lines">@@ -251,7 +255,7 @@
</span><span class="cx">         break;
</span><span class="cx"> 
</span><span class="cx"> case 'delete':
</span><del>-        check_admin_referer('delete-post_' . $post_id);
</del><ins>+        check_admin_referer('delete-' . $post_type . '_' . $post_id);
</ins><span class="cx"> 
</span><span class="cx">         if ( !current_user_can('delete_' . $post_type_cap, $post_id) )
</span><span class="cx">                 wp_die( __('You are not allowed to delete this item.') );
</span><span class="lines">@@ -280,9 +284,6 @@
</span><span class="cx">         break;
</span><span class="cx"> 
</span><span class="cx"> default:
</span><del>-        if ( $post_type_object-&gt;hierarchical )
-                wp_redirect('edit-pages.php');
-        else
</del><span class="cx">                 wp_redirect('edit.php');
</span><span class="cx">         exit();
</span><span class="cx">         break;
</span></span></pre></div>
<a id="trunkwpadminthemeinstallphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/theme-install.php (12727 => 12728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/theme-install.php        2010-01-15 16:39:11 UTC (rev 12727)
+++ trunk/wp-admin/theme-install.php        2010-01-15 16:58:36 UTC (rev 12728)
</span><span class="lines">@@ -52,6 +52,8 @@
</span><span class="cx"> 
</span><span class="cx"> do_action('install_themes_pre_' . $tab); //Used to override the general interface, Eg, install or theme information.
</span><span class="cx"> 
</span><ins>+add_contextual_help($current_screen, plugins_search_help());
+
</ins><span class="cx"> include('admin-header.php');
</span><span class="cx"> ?&gt;
</span><span class="cx"> &lt;div class=&quot;wrap&quot;&gt;
</span></span></pre></div>
<a id="trunkwpadminthemesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/themes.php (12727 => 12728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/themes.php        2010-01-15 16:39:11 UTC (rev 12727)
+++ trunk/wp-admin/themes.php        2010-01-15 16:58:36 UTC (rev 12728)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx">         $help .= '&lt;p&gt;' . __('Once a theme is uploaded, you should see it on this page.') . '&lt;/p&gt;' ;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-add_contextual_help('themes', $help);
</del><ins>+add_contextual_help($current_screen, $help);
</ins><span class="cx"> 
</span><span class="cx"> add_thickbox();
</span><span class="cx"> wp_enqueue_script( 'theme-preview' );
</span></span></pre></div>
<a id="trunkwpadminwidgetsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/widgets.php (12727 => 12728)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/widgets.php        2010-01-15 16:39:11 UTC (rev 12727)
+++ trunk/wp-admin/widgets.php        2010-01-15 16:58:36 UTC (rev 12728)
</span><span class="lines">@@ -33,6 +33,14 @@
</span><span class="cx"> $title = __( 'Widgets' );
</span><span class="cx"> $parent_file = 'themes.php';
</span><span class="cx"> 
</span><ins>+$help = '
+        &lt;p&gt;' . __('Widgets are added and arranged by simple drag &amp;#8217;n&amp;#8217; drop. If you hover your mouse over the titlebar of a widget, you&amp;#8217;ll see a 4-arrow cursor which indicates that the widget is movable.  Click on the titlebar, hold down the mouse button and drag the widget to a sidebar. As you drag, you&amp;#8217;ll see a dotted box that also moves. This box shows where the widget will go once you drop it.') . '&lt;/p&gt;
+        &lt;p&gt;' . __('To remove a widget from a sidebar, drag it back to Available Widgets or click on the arrow on its titlebar to reveal its settings, and then click Remove.') . '&lt;/p&gt;
+        &lt;p&gt;' . __('To remove a widget from a sidebar &lt;em&gt;and keep its configuration&lt;/em&gt;, drag it to Inactive Widgets.') . '&lt;/p&gt;
+        &lt;p&gt;' . __('The Inactive Widgets area stores widgets that are configured but not curently used. If you change themes and the new theme has fewer sidebars than the old, all extra widgets will be stored to Inactive Widgets automatically.') . '&lt;/p&gt;
+';
+add_contextual_help($current_screen, $help);
+
</ins><span class="cx"> // register the inactive_widgets area as sidebar
</span><span class="cx"> register_sidebar(array(
</span><span class="cx">         'name' =&gt; __('Inactive Widgets'),
</span></span></pre>
</div>
</div>

</body>
</html>