<!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" />
<title>[21914] trunk/wp-admin/includes: Reduce reliance on global variables in the list tables.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { 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 #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#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>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/21914">21914</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2012-09-19 12:43:31 +0000 (Wed, 19 Sep 2012)</dd>
</dl>
<h3>Log Message</h3>
<pre>Reduce reliance on global variables in the list tables. Allow passing a screen ID to the list tables so that ajax handlers can set the needed screen.
Props nacin
fixes <a href="http://core.trac.wordpress.org/ticket/21871">#21871</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesajaxactionsphp">trunk/wp-admin/includes/ajax-actions.php</a></li>
<li><a href="#trunkwpadminincludesclasswplinkslisttablephp">trunk/wp-admin/includes/class-wp-links-list-table.php</a></li>
<li><a href="#trunkwpadminincludesclasswplisttablephp">trunk/wp-admin/includes/class-wp-list-table.php</a></li>
<li><a href="#trunkwpadminincludesclasswpmedialisttablephp">trunk/wp-admin/includes/class-wp-media-list-table.php</a></li>
<li><a href="#trunkwpadminincludesclasswpmssiteslisttablephp">trunk/wp-admin/includes/class-wp-ms-sites-list-table.php</a></li>
<li><a href="#trunkwpadminincludesclasswpmsthemeslisttablephp">trunk/wp-admin/includes/class-wp-ms-themes-list-table.php</a></li>
<li><a href="#trunkwpadminincludesclasswppluginslisttablephp">trunk/wp-admin/includes/class-wp-plugins-list-table.php</a></li>
<li><a href="#trunkwpadminincludesclasswppostslisttablephp">trunk/wp-admin/includes/class-wp-posts-list-table.php</a></li>
<li><a href="#trunkwpadminincludesclasswptermslisttablephp">trunk/wp-admin/includes/class-wp-terms-list-table.php</a></li>
<li><a href="#trunkwpadminincludesclasswpthemeslisttablephp">trunk/wp-admin/includes/class-wp-themes-list-table.php</a></li>
<li><a href="#trunkwpadminincludesclasswpuserslisttablephp">trunk/wp-admin/includes/class-wp-users-list-table.php</a></li>
<li><a href="#trunkwpadminincludeslisttablephp">trunk/wp-admin/includes/list-table.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/ajax-actions.php (21913 => 21914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/ajax-actions.php        2012-09-19 01:51:40 UTC (rev 21913)
+++ trunk/wp-admin/includes/ajax-actions.php        2012-09-19 12:43:31 UTC (rev 21914)
</span><span class="lines">@@ -29,17 +29,12 @@
</span><span class="cx"> * GET-based Ajax handlers.
</span><span class="cx"> */
</span><span class="cx"> function wp_ajax_fetch_list() {
</span><del>-        global $current_screen, $wp_list_table;
</del><ins>+        global $wp_list_table;
</ins><span class="cx">
</span><span class="cx">         $list_class = $_GET['list_args']['class'];
</span><span class="cx">         check_ajax_referer( "fetch-list-$list_class", '_ajax_fetch_list_nonce' );
</span><span class="cx">
</span><del>-        $current_screen = convert_to_screen( $_GET['list_args']['screen']['id'] );
-
-        define( 'WP_NETWORK_ADMIN', $current_screen->is_network );
-        define( 'WP_USER_ADMIN', $current_screen->is_user );
-
-        $wp_list_table = _get_list_table( $list_class );
</del><ins>+        $wp_list_table = _get_list_table( $list_class, array( 'screen' => $_GET['list_args']['screen']['id'] ) );
</ins><span class="cx">         if ( ! $wp_list_table )
</span><span class="cx">                 wp_die( 0 );
</span><span class="cx">
</span><span class="lines">@@ -615,10 +610,8 @@
</span><span class="cx">                 $x->send();
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        set_current_screen( $_POST['screen'] );
</del><ins>+        $wp_list_table = _get_list_table( 'WP_Terms_List_Table', array( 'screen' => $_POST['screen'] ) );
</ins><span class="cx">
</span><del>-        $wp_list_table = _get_list_table('WP_Terms_List_Table');
-
</del><span class="cx">         $level = 0;
</span><span class="cx">         if ( is_taxonomy_hierarchical($taxonomy) ) {
</span><span class="cx">                 $level = count( get_ancestors( $tag->term_id, $taxonomy ) );
</span><span class="lines">@@ -686,10 +679,8 @@
</span><span class="cx">
</span><span class="cx">         check_ajax_referer( $action );
</span><span class="cx">
</span><del>-        set_current_screen( 'edit-comments' );
</del><ins>+        $wp_list_table = _get_list_table( 'WP_Post_Comments_List_Table', array( 'screen' => 'edit-comments' ) );
</ins><span class="cx">
</span><del>-        $wp_list_table = _get_list_table('WP_Post_Comments_List_Table');
-
</del><span class="cx">         if ( !current_user_can( 'edit_post', $post_id ) )
</span><span class="cx">                 wp_die( -1 );
</span><span class="cx">
</span><span class="lines">@@ -723,8 +714,6 @@
</span><span class="cx">
</span><span class="cx">         check_ajax_referer( $action, '_ajax_nonce-replyto-comment' );
</span><span class="cx">
</span><del>-        set_current_screen( 'edit-comments' );
-
</del><span class="cx">         $comment_post_ID = (int) $_POST['comment_post_ID'];
</span><span class="cx">         if ( !current_user_can( 'edit_post', $comment_post_ID ) )
</span><span class="cx">                 wp_die( -1 );
</span><span class="lines">@@ -782,9 +771,9 @@
</span><span class="cx">                         _wp_dashboard_recent_comments_row( $comment );
</span><span class="cx">                 } else {
</span><span class="cx">                         if ( 'single' == $_REQUEST['mode'] ) {
</span><del>-                                $wp_list_table = _get_list_table('WP_Post_Comments_List_Table');
</del><ins>+                                $wp_list_table = _get_list_table('WP_Post_Comments_List_Table', array( 'screen' => 'edit-comments' ) );
</ins><span class="cx">                         } else {
</span><del>-                                $wp_list_table = _get_list_table('WP_Comments_List_Table');
</del><ins>+                                $wp_list_table = _get_list_table('WP_Comments_List_Table', array( 'screen' => 'edit-comments' ) );
</ins><span class="cx">                         }
</span><span class="cx">                         $wp_list_table->single_row( $comment );
</span><span class="cx">                 }
</span><span class="lines">@@ -811,8 +800,6 @@
</span><span class="cx">
</span><span class="cx">         check_ajax_referer( 'replyto-comment', '_ajax_nonce-replyto-comment' );
</span><span class="cx">
</span><del>-        set_current_screen( 'edit-comments' );
-
</del><span class="cx">         $comment_id = (int) $_POST['comment_ID'];
</span><span class="cx">         if ( ! current_user_can( 'edit_comment', $comment_id ) )
</span><span class="cx">                 wp_die( -1 );
</span><span class="lines">@@ -827,7 +814,7 @@
</span><span class="cx">         $comments_status = isset($_POST['comments_listing']) ? $_POST['comments_listing'] : '';
</span><span class="cx">
</span><span class="cx">         $checkbox = ( isset($_POST['checkbox']) && true == $_POST['checkbox'] ) ? 1 : 0;
</span><del>-        $wp_list_table = _get_list_table( $checkbox ? 'WP_Comments_List_Table' : 'WP_Post_Comments_List_Table' );
</del><ins>+        $wp_list_table = _get_list_table( $checkbox ? 'WP_Comments_List_Table' : 'WP_Post_Comments_List_Table', array( 'screen' => 'edit-comments' ) );
</ins><span class="cx">
</span><span class="cx">         $comment = get_comment( $comment_id );
</span><span class="cx">
</span><span class="lines">@@ -1330,8 +1317,6 @@
</span><span class="cx">                         wp_die( __( 'You are not allowed to edit this post.' ) );
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        set_current_screen( $_POST['screen'] );
-
</del><span class="cx">         if ( $last = wp_check_post_lock( $post_ID ) ) {
</span><span class="cx">                 $last_user = get_userdata( $last );
</span><span class="cx">                 $last_user_name = $last_user ? $last_user->display_name : __( 'Someone' );
</span><span class="lines">@@ -1367,7 +1352,7 @@
</span><span class="cx">         // update the post
</span><span class="cx">         edit_post();
</span><span class="cx">
</span><del>-        $wp_list_table = _get_list_table('WP_Posts_List_Table');
</del><ins>+        $wp_list_table = _get_list_table( 'WP_Posts_List_Table', array( 'screen' => $_POST['screen'] ) );
</ins><span class="cx">
</span><span class="cx">         $mode = $_POST['post_view'];
</span><span class="cx">
</span><span class="lines">@@ -1399,10 +1384,8 @@
</span><span class="cx">         if ( ! current_user_can( $tax->cap->edit_terms ) )
</span><span class="cx">                 wp_die( -1 );
</span><span class="cx">
</span><del>-        set_current_screen( 'edit-' . $taxonomy );
</del><ins>+        $wp_list_table = _get_list_table( 'WP_Terms_List_Table', array( 'screen' => 'edit-' . $taxonomy ) );
</ins><span class="cx">
</span><del>-        $wp_list_table = _get_list_table('WP_Terms_List_Table');
-
</del><span class="cx">         if ( ! isset($_POST['tax_ID']) || ! ( $id = (int) $_POST['tax_ID'] ) )
</span><span class="cx">                 wp_die( -1 );
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminincludesclasswplinkslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-links-list-table.php (21913 => 21914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-links-list-table.php        2012-09-19 01:51:40 UTC (rev 21913)
+++ trunk/wp-admin/includes/class-wp-links-list-table.php        2012-09-19 12:43:31 UTC (rev 21914)
</span><span class="lines">@@ -9,9 +9,10 @@
</span><span class="cx"> */
</span><span class="cx"> class WP_Links_List_Table extends WP_List_Table {
</span><span class="cx">
</span><del>-        function __construct() {
</del><ins>+        function __construct( $args = array() ) {
</ins><span class="cx">                 parent::__construct( array(
</span><span class="cx">                         'plural' => 'bookmarks',
</span><ins>+                        'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
</ins><span class="cx">                 ) );
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminincludesclasswplisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-list-table.php (21913 => 21914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-list-table.php        2012-09-19 01:51:40 UTC (rev 21913)
+++ trunk/wp-admin/includes/class-wp-list-table.php        2012-09-19 12:43:31 UTC (rev 21914)
</span><span class="lines">@@ -81,15 +81,16 @@
</span><span class="cx">                 $args = wp_parse_args( $args, array(
</span><span class="cx">                         'plural' => '',
</span><span class="cx">                         'singular' => '',
</span><del>-                        'ajax' => false
</del><ins>+                        'ajax' => false,
+                        'screen' => null,
</ins><span class="cx">                 ) );
</span><span class="cx">
</span><del>-                $screen = get_current_screen();
</del><ins>+                $this->screen = convert_to_screen( $args['screen'] );
</ins><span class="cx">
</span><del>-                add_filter( "manage_{$screen->id}_columns", array( &$this, 'get_columns' ), 0 );
</del><ins>+                add_filter( "manage_{$this->screen->id}_columns", array( &$this, 'get_columns' ), 0 );
</ins><span class="cx">
</span><span class="cx">                 if ( !$args['plural'] )
</span><del>-                        $args['plural'] = $screen->base;
</del><ins>+                        $args['plural'] = $this->screen->base;
</ins><span class="cx">
</span><span class="cx">                 $args['plural'] = sanitize_key( $args['plural'] );
</span><span class="cx">                 $args['singular'] = sanitize_key( $args['singular'] );
</span><span class="lines">@@ -242,10 +243,8 @@
</span><span class="cx">          * @access public
</span><span class="cx">          */
</span><span class="cx">         function views() {
</span><del>-                $screen = get_current_screen();
-
</del><span class="cx">                 $views = $this->get_views();
</span><del>-                $views = apply_filters( 'views_' . $screen->id, $views );
</del><ins>+                $views = apply_filters( 'views_' . $this->screen->id, $views );
</ins><span class="cx">
</span><span class="cx">                 if ( empty( $views ) )
</span><span class="cx">                         return;
</span><span class="lines">@@ -278,12 +277,10 @@
</span><span class="cx">          * @access public
</span><span class="cx">          */
</span><span class="cx">         function bulk_actions() {
</span><del>-                $screen = get_current_screen();
-
</del><span class="cx">                 if ( is_null( $this->_actions ) ) {
</span><span class="cx">                         $no_new_actions = $this->_actions = $this->get_bulk_actions();
</span><span class="cx">                         // This filter can currently only be used to remove actions.
</span><del>-                        $this->_actions = apply_filters( 'bulk_actions-' . $screen->id, $this->_actions );
</del><ins>+                        $this->_actions = apply_filters( 'bulk_actions-' . $this->screen->id, $this->_actions );
</ins><span class="cx">                         $this->_actions = array_intersect_assoc( $this->_actions, $no_new_actions );
</span><span class="cx">                         $two = '';
</span><span class="cx">                 } else {
</span><span class="lines">@@ -604,13 +601,11 @@
</span><span class="cx">                 if ( isset( $this->_column_headers ) )
</span><span class="cx">                         return $this->_column_headers;
</span><span class="cx">
</span><del>-                $screen = get_current_screen();
</del><ins>+                $columns = get_column_headers( $this->screen );
+                $hidden = get_hidden_columns( $this->screen );
</ins><span class="cx">
</span><del>-                $columns = get_column_headers( $screen );
-                $hidden = get_hidden_columns( $screen );
</del><ins>+                $_sortable = apply_filters( "manage_{$this->screen->id}_sortable_columns", $this->get_sortable_columns() );
</ins><span class="cx">
</span><del>-                $_sortable = apply_filters( "manage_{$screen->id}_sortable_columns", $this->get_sortable_columns() );
-
</del><span class="cx">                 $sortable = array();
</span><span class="cx">                 foreach ( $_sortable as $id => $data ) {
</span><span class="cx">                         if ( empty( $data ) )
</span><span class="lines">@@ -651,8 +646,6 @@
</span><span class="cx">          * @param bool $with_id Whether to set the id attribute or not
</span><span class="cx">          */
</span><span class="cx">         function print_column_headers( $with_id = true ) {
</span><del>-                $screen = get_current_screen();
-
</del><span class="cx">                 list( $columns, $hidden, $sortable ) = $this->get_column_info();
</span><span class="cx">
</span><span class="cx">                 $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
</span><span class="lines">@@ -914,13 +907,11 @@
</span><span class="cx">          * @access private
</span><span class="cx">          */
</span><span class="cx">         function _js_vars() {
</span><del>-                $current_screen = get_current_screen();
-
</del><span class="cx">                 $args = array(
</span><span class="cx">                         'class' => get_class( $this ),
</span><span class="cx">                         'screen' => array(
</span><del>-                                'id' => $current_screen->id,
-                                'base' => $current_screen->base,
</del><ins>+                                'id' => $this->screen->id,
+                                'base' => $this->screen->base,
</ins><span class="cx">                         )
</span><span class="cx">                 );
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminincludesclasswpmedialisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-media-list-table.php (21913 => 21914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-media-list-table.php        2012-09-19 01:51:40 UTC (rev 21913)
+++ trunk/wp-admin/includes/class-wp-media-list-table.php        2012-09-19 12:43:31 UTC (rev 21914)
</span><span class="lines">@@ -9,11 +9,12 @@
</span><span class="cx"> */
</span><span class="cx"> class WP_Media_List_Table extends WP_List_Table {
</span><span class="cx">
</span><del>-        function __construct() {
</del><ins>+        function __construct( $args = array() ) {
</ins><span class="cx">                 $this->detached = isset( $_REQUEST['detached'] ) || isset( $_REQUEST['find_detached'] );
</span><span class="cx">
</span><span class="cx">                 parent::__construct( array(
</span><del>-                        'plural' => 'media'
</del><ins>+                        'plural' => 'media',
+                        'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
</ins><span class="cx">                 ) );
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminincludesclasswpmssiteslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-ms-sites-list-table.php (21913 => 21914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-ms-sites-list-table.php        2012-09-19 01:51:40 UTC (rev 21913)
+++ trunk/wp-admin/includes/class-wp-ms-sites-list-table.php        2012-09-19 12:43:31 UTC (rev 21914)
</span><span class="lines">@@ -9,9 +9,10 @@
</span><span class="cx"> */
</span><span class="cx"> class WP_MS_Sites_List_Table extends WP_List_Table {
</span><span class="cx">
</span><del>-        function __construct() {
</del><ins>+        function __construct( $args = array() ) {
</ins><span class="cx">                 parent::__construct( array(
</span><span class="cx">                         'plural' => 'sites',
</span><ins>+                        'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
</ins><span class="cx">                 ) );
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminincludesclasswpmsthemeslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-ms-themes-list-table.php (21913 => 21914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-ms-themes-list-table.php        2012-09-19 01:51:40 UTC (rev 21913)
+++ trunk/wp-admin/includes/class-wp-ms-themes-list-table.php        2012-09-19 12:43:31 UTC (rev 21914)
</span><span class="lines">@@ -12,24 +12,24 @@
</span><span class="cx">         var $site_id;
</span><span class="cx">         var $is_site_themes;
</span><span class="cx">
</span><del>-        function __construct() {
</del><ins>+        function __construct( $args = array() ) {
</ins><span class="cx">                 global $status, $page;
</span><span class="cx">
</span><ins>+                parent::__construct( array(
+                        'plural' => 'themes',
+                        'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
+                ) );
+
</ins><span class="cx">                 $status = isset( $_REQUEST['theme_status'] ) ? $_REQUEST['theme_status'] : 'all';
</span><span class="cx">                 if ( !in_array( $status, array( 'all', 'enabled', 'disabled', 'upgrade', 'search', 'broken' ) ) )
</span><span class="cx">                         $status = 'all';
</span><span class="cx">
</span><span class="cx">                 $page = $this->get_pagenum();
</span><span class="cx">
</span><del>-                $screen = get_current_screen();
-                $this->is_site_themes = ( 'site-themes-network' == $screen->id ) ? true : false;
</del><ins>+                $this->is_site_themes = ( 'site-themes-network' == $this->screen->id ) ? true : false;
</ins><span class="cx">
</span><span class="cx">                 if ( $this->is_site_themes )
</span><span class="cx">                         $this->site_id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
</span><del>-
-                parent::__construct( array(
-                        'plural' => 'themes'
-                ) );
</del><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function get_table_classes() {
</span></span></pre></div>
<a id="trunkwpadminincludesclasswppluginslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-plugins-list-table.php (21913 => 21914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-plugins-list-table.php        2012-09-19 01:51:40 UTC (rev 21913)
+++ trunk/wp-admin/includes/class-wp-plugins-list-table.php        2012-09-19 12:43:31 UTC (rev 21914)
</span><span class="lines">@@ -9,9 +9,14 @@
</span><span class="cx"> */
</span><span class="cx"> class WP_Plugins_List_Table extends WP_List_Table {
</span><span class="cx">
</span><del>-        function __construct() {
</del><ins>+        function __construct( $args = array() ) {
</ins><span class="cx">                 global $status, $page;
</span><span class="cx">
</span><ins>+                parent::__construct( array(
+                        'plural' => 'plugins',
+                        'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
+                ) );
+
</ins><span class="cx">                 $status = 'all';
</span><span class="cx">                 if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], array( 'active', 'inactive', 'recently_activated', 'upgrade', 'mustuse', 'dropins', 'search' ) ) )
</span><span class="cx">                         $status = $_REQUEST['plugin_status'];
</span><span class="lines">@@ -20,10 +25,6 @@
</span><span class="cx">                         $_SERVER['REQUEST_URI'] = add_query_arg('s', stripslashes($_REQUEST['s']) );
</span><span class="cx">
</span><span class="cx">                 $page = $this->get_pagenum();
</span><del>-
-                parent::__construct( array(
-                        'plural' => 'plugins',
-                ) );
</del><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function get_table_classes() {
</span><span class="lines">@@ -50,7 +51,7 @@
</span><span class="cx">                         'dropins' => array()
</span><span class="cx">                 );
</span><span class="cx">
</span><del>-                $screen = get_current_screen();
</del><ins>+                $screen = $this->screen;
</ins><span class="cx">
</span><span class="cx">                 if ( ! is_multisite() || ( $screen->is_network && current_user_can('manage_network_plugins') ) ) {
</span><span class="cx">                         if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) )
</span><span class="lines">@@ -91,7 +92,7 @@
</span><span class="cx">                                 || ( $screen->is_network && is_plugin_active_for_network( $plugin_file ) ) ) {
</span><span class="cx">                                 $plugins['active'][ $plugin_file ] = $plugin_data;
</span><span class="cx">                         } else {
</span><del>-                                if ( !$screen->is_network && isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated?
</del><ins>+                                if ( ! $screen->is_network && isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated?
</ins><span class="cx">                                         $plugins['recently_activated'][ $plugin_file ] = $plugin_data;
</span><span class="cx">                                 $plugins['inactive'][ $plugin_file ] = $plugin_data;
</span><span class="cx">                         }
</span><span class="lines">@@ -236,15 +237,13 @@
</span><span class="cx">
</span><span class="cx">                 $actions = array();
</span><span class="cx">
</span><del>-                $screen = get_current_screen();
-
</del><span class="cx">                 if ( 'active' != $status )
</span><del>-                        $actions['activate-selected'] = $screen->is_network ? __( 'Network Activate' ) : __( 'Activate' );
</del><ins>+                        $actions['activate-selected'] = $this->screen->is_network ? __( 'Network Activate' ) : __( 'Activate' );
</ins><span class="cx">
</span><span class="cx">                 if ( 'inactive' != $status && 'recent' != $status )
</span><del>-                        $actions['deactivate-selected'] = $screen->is_network ? __( 'Network Deactivate' ) : __( 'Deactivate' );
</del><ins>+                        $actions['deactivate-selected'] = $this->screen->is_network ? __( 'Network Deactivate' ) : __( 'Deactivate' );
</ins><span class="cx">
</span><del>-                if ( !is_multisite() || $screen->is_network ) {
</del><ins>+                if ( !is_multisite() || $this->screen->is_network ) {
</ins><span class="cx">                         if ( current_user_can( 'update_plugins' ) )
</span><span class="cx">                                 $actions['update-selected'] = __( 'Update' );
</span><span class="cx">                         if ( current_user_can( 'delete_plugins' ) && ( 'active' != $status ) )
</span><span class="lines">@@ -271,9 +270,7 @@
</span><span class="cx">
</span><span class="cx">                 echo '<div class="alignleft actions">';
</span><span class="cx">
</span><del>-                $screen = get_current_screen();
-
-                if ( ! $screen->is_network && 'recently_activated' == $status )
</del><ins>+                if ( ! $this->screen->is_network && 'recently_activated' == $status )
</ins><span class="cx">                         submit_button( __( 'Clear List' ), 'small', 'clear-recent-list', false );
</span><span class="cx">                 elseif ( 'top' == $which && 'mustuse' == $status )
</span><span class="cx">                         echo '<p>' . sprintf( __( 'Files in the <code>%s</code> directory are executed automatically.' ), str_replace( ABSPATH, '/', WPMU_PLUGIN_DIR ) ) . '</p>';
</span><span class="lines">@@ -293,9 +290,7 @@
</span><span class="cx">         function display_rows() {
</span><span class="cx">                 global $status;
</span><span class="cx">
</span><del>-                $screen = get_current_screen();
-
-                if ( is_multisite() && !$screen->is_network && in_array( $status, array( 'mustuse', 'dropins' ) ) )
</del><ins>+                if ( is_multisite() && ! $this->screen->is_network && in_array( $status, array( 'mustuse', 'dropins' ) ) )
</ins><span class="cx">                         return;
</span><span class="cx">
</span><span class="cx">                 foreach ( $this->items as $plugin_file => $plugin_data )
</span><span class="lines">@@ -306,9 +301,8 @@
</span><span class="cx">                 global $status, $page, $s, $totals;
</span><span class="cx">
</span><span class="cx">                 $context = $status;
</span><ins>+                $screen = $this->screen;
</ins><span class="cx">
</span><del>-                $screen = get_current_screen();
-
</del><span class="cx">                 // preorder
</span><span class="cx">                 $actions = array(
</span><span class="cx">                         'deactivate' => '',
</span></span></pre></div>
<a id="trunkwpadminincludesclasswppostslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-posts-list-table.php (21913 => 21914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-posts-list-table.php        2012-09-19 01:51:40 UTC (rev 21913)
+++ trunk/wp-admin/includes/class-wp-posts-list-table.php        2012-09-19 12:43:31 UTC (rev 21914)
</span><span class="lines">@@ -45,10 +45,15 @@
</span><span class="cx">          */
</span><span class="cx">         var $sticky_posts_count = 0;
</span><span class="cx">
</span><del>-        function __construct() {
</del><ins>+        function __construct( $args = array() ) {
</ins><span class="cx">                 global $post_type_object, $wpdb;
</span><span class="cx">
</span><del>-                $post_type = get_current_screen()->post_type;
</del><ins>+                parent::__construct( array(
+                        'plural' => 'posts',
+                        'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
+                ) );
+
+                $post_type = $this->screen->post_type;
</ins><span class="cx">                 $post_type_object = get_post_type_object( $post_type );
</span><span class="cx">
</span><span class="cx">                 if ( !current_user_can( $post_type_object->cap->edit_others_posts ) ) {
</span><span class="lines">@@ -66,28 +71,22 @@
</span><span class="cx">                         $sticky_posts = implode( ', ', array_map( 'absint', (array) $sticky_posts ) );
</span><span class="cx">                         $this->sticky_posts_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( 1 ) FROM $wpdb->posts WHERE post_type = %s AND post_status != 'trash' AND ID IN ($sticky_posts)", $post_type ) );
</span><span class="cx">                 }
</span><del>-
-                parent::__construct( array(
-                        'plural' => 'posts',
-                ) );
</del><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function ajax_user_can() {
</span><del>-                global $post_type_object;
-
-                return current_user_can( $post_type_object->cap->edit_posts );
</del><ins>+                return current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_posts );
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function prepare_items() {
</span><del>-                global $post_type_object, $avail_post_stati, $wp_query, $per_page, $mode;
</del><ins>+                global $avail_post_stati, $wp_query, $per_page, $mode;
</ins><span class="cx">
</span><span class="cx">                 $avail_post_stati = wp_edit_posts_query();
</span><span class="cx">
</span><del>-                $this->hierarchical_display = ( $post_type_object->hierarchical && 'menu_order title' == $wp_query->query['orderby'] );
</del><ins>+                $this->hierarchical_display = ( is_post_type_hierarchical( $this->screen->post_type ) && 'menu_order title' == $wp_query->query['orderby'] );
</ins><span class="cx">
</span><span class="cx">                 $total_items = $this->hierarchical_display ? $wp_query->post_count : $wp_query->found_posts;
</span><span class="cx">
</span><del>-                $post_type = $post_type_object->name;
</del><ins>+                $post_type = $this->screen->post_type;
</ins><span class="cx">                 $per_page = $this->get_items_per_page( 'edit_' . $post_type . '_per_page' );
</span><span class="cx">                 $per_page = apply_filters( 'edit_posts_per_page', $per_page, $post_type );
</span><span class="cx">
</span><span class="lines">@@ -112,18 +111,16 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function no_items() {
</span><del>-                global $post_type_object;
-
</del><span class="cx">                 if ( isset( $_REQUEST['post_status'] ) && 'trash' == $_REQUEST['post_status'] )
</span><del>-                        echo $post_type_object->labels->not_found_in_trash;
</del><ins>+                        echo get_post_type_object( $this->screen->post_type )->labels->not_found_in_trash;
</ins><span class="cx">                 else
</span><del>-                        echo $post_type_object->labels->not_found;
</del><ins>+                        echo get_post_type_object( $this->screen->post_type )->labels->not_found;
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function get_views() {
</span><del>-                global $post_type_object, $locked_post_status, $avail_post_stati;
</del><ins>+                global $locked_post_status, $avail_post_stati;
</ins><span class="cx">
</span><del>-                $post_type = $post_type_object->name;
</del><ins>+                $post_type = $this->screen->post_type;
</ins><span class="cx">
</span><span class="cx">                 if ( !empty($locked_post_status) )
</span><span class="cx">                         return array();
</span><span class="lines">@@ -198,15 +195,15 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function extra_tablenav( $which ) {
</span><del>-                global $post_type_object, $cat;
</del><ins>+                global $cat;
</ins><span class="cx"> ?>
</span><span class="cx">                 <div class="alignleft actions">
</span><span class="cx"> <?php
</span><span class="cx">                 if ( 'top' == $which && !is_singular() ) {
</span><span class="cx">
</span><del>-                        $this->months_dropdown( $post_type_object->name );
</del><ins>+                        $this->months_dropdown( $this->screen->post_type );
</ins><span class="cx">
</span><del>-                        if ( is_object_in_taxonomy( $post_type_object->name, 'category' ) ) {
</del><ins>+                        if ( is_object_in_taxonomy( $this->screen->post_type, 'category' ) ) {
</ins><span class="cx">                                 $dropdown_options = array(
</span><span class="cx">                                         'show_option_all' => __( 'View all categories' ),
</span><span class="cx">                                         'hide_empty' => 0,
</span><span class="lines">@@ -221,7 +218,7 @@
</span><span class="cx">                         submit_button( __( 'Filter' ), 'small', false, false, array( 'id' => 'post-query-submit' ) );
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if ( $this->is_trash && current_user_can( $post_type_object->cap->edit_others_posts ) ) {
</del><ins>+                if ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_others_posts ) ) {
</ins><span class="cx">                         submit_button( __( 'Empty Trash' ), 'small apply', 'delete_all', false );
</span><span class="cx">                 }
</span><span class="cx"> ?>
</span><span class="lines">@@ -237,28 +234,21 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function pagination( $which ) {
</span><del>-                global $post_type_object, $mode;
</del><ins>+                global $mode;
</ins><span class="cx">
</span><span class="cx">                 parent::pagination( $which );
</span><span class="cx">
</span><del>-                if ( 'top' == $which && !$post_type_object->hierarchical )
</del><ins>+                if ( 'top' == $which && ! is_post_type_hierarchical( $this->screen->post_type ) )
</ins><span class="cx">                         $this->view_switcher( $mode );
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function get_table_classes() {
</span><del>-                global $post_type_object;
-
-                return array( 'widefat', 'fixed', $post_type_object->hierarchical ? 'pages' : 'posts' );
</del><ins>+                return array( 'widefat', 'fixed', is_post_type_hierarchical( $this->screen->post_type ) ? 'pages' : 'posts' );
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function get_columns() {
</span><del>-                $screen = get_current_screen();
</del><ins>+                $post_type = $this->screen->post_type;
</ins><span class="cx">
</span><del>-                if ( empty( $screen ) )
-                        $post_type = 'post';
-                else
-                        $post_type = $screen->post_type;
-
</del><span class="cx">                 $posts_columns = array();
</span><span class="cx">
</span><span class="cx">                 $posts_columns['cb'] = '<input type="checkbox" />';
</span><span class="lines">@@ -313,7 +303,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function display_rows( $posts = array(), $level = 0 ) {
</span><del>-                global $wp_query, $post_type_object, $per_page;
</del><ins>+                global $wp_query, $per_page;
</ins><span class="cx">
</span><span class="cx">                 if ( empty( $posts ) )
</span><span class="cx">                         $posts = $wp_query->posts;
</span><span class="lines">@@ -701,7 +691,7 @@
</span><span class="cx">         function inline_edit() {
</span><span class="cx">                 global $mode;
</span><span class="cx">
</span><del>-                $screen = get_current_screen();
</del><ins>+                $screen = $this->screen;
</ins><span class="cx">
</span><span class="cx">                 $post = get_default_post_to_edit( $screen->post_type );
</span><span class="cx">                 $post_type_object = get_post_type_object( $screen->post_type );
</span><span class="lines">@@ -733,8 +723,8 @@
</span><span class="cx">                 $bulk = 0;
</span><span class="cx">                 while ( $bulk < 2 ) { ?>
</span><span class="cx">
</span><del>-                <tr id="<?php echo $bulk ? 'bulk-edit' : 'inline-edit'; ?>" class="inline-edit-row inline-edit-row-<?php echo "$hclass inline-edit-$screen->post_type ";
-                        echo $bulk ? "bulk-edit-row bulk-edit-row-$hclass bulk-edit-$screen->post_type" : "quick-edit-row quick-edit-row-$hclass inline-edit-$screen->post_type";
</del><ins>+                <tr id="<?php echo $bulk ? 'bulk-edit' : 'inline-edit'; ?>" class="inline-edit-row inline-edit-row-<?php echo "$hclass inline-edit-" . $screen->post_type;
+                        echo $bulk ? "bulk-edit-row bulk-edit-row-$hclass bulk-edit-{$screen->post_type}" : "quick-edit-row quick-edit-row-$hclass inline-edit-{$screen->post_type}";
</ins><span class="cx">                 ?>" style="display: none"><td colspan="<?php echo $this->get_column_count(); ?>" class="colspanchange">
</span><span class="cx">
</span><span class="cx">                 <fieldset class="inline-edit-col-left"><div class="inline-edit-col">
</span></span></pre></div>
<a id="trunkwpadminincludesclasswptermslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-terms-list-table.php (21913 => 21914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-terms-list-table.php        2012-09-19 01:51:40 UTC (rev 21913)
+++ trunk/wp-admin/includes/class-wp-terms-list-table.php        2012-09-19 12:43:31 UTC (rev 21914)
</span><span class="lines">@@ -11,43 +11,44 @@
</span><span class="cx">
</span><span class="cx">         var $callback_args;
</span><span class="cx">
</span><del>-        function __construct() {
-                global $post_type, $taxonomy, $tax;
</del><ins>+        function __construct( $args = array() ) {
+                global $post_type, $taxonomy, $action, $tax;
</ins><span class="cx">
</span><del>-                wp_reset_vars( array( 'action', 'taxonomy', 'post_type' ) );
</del><ins>+                parent::__construct( array(
+                        'plural' => 'tags',
+                        'singular' => 'tag',
+                        'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
+                ) );
</ins><span class="cx">
</span><ins>+                $action = $this->screen->action;
+                $post_type = $this->screen->post_type;
+                $taxonomy = $this->screen->taxonomy;
+
</ins><span class="cx">                 if ( empty( $taxonomy ) )
</span><span class="cx">                         $taxonomy = 'post_tag';
</span><span class="cx">
</span><del>-                if ( !taxonomy_exists( $taxonomy ) )
</del><ins>+                if ( ! taxonomy_exists( $taxonomy ) )
</ins><span class="cx">                         wp_die( __( 'Invalid taxonomy' ) );
</span><span class="cx">
</span><span class="cx">                 $tax = get_taxonomy( $taxonomy );
</span><span class="cx">
</span><ins>+                // @todo Still needed? Maybe just the show_ui part.
</ins><span class="cx">                 if ( empty( $post_type ) || !in_array( $post_type, get_post_types( array( 'show_ui' => true ) ) ) )
</span><span class="cx">                         $post_type = 'post';
</span><span class="cx">
</span><del>-                parent::__construct( array(
-                        'plural' => 'tags',
-                        'singular' => 'tag',
-                ) );
</del><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function ajax_user_can() {
</span><del>-                global $tax;
-
-                return current_user_can( $tax->cap->manage_terms );
</del><ins>+                return current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->manage_terms );
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function prepare_items() {
</span><del>-                global $taxonomy;
</del><ins>+                $tags_per_page = $this->get_items_per_page( 'edit_' . $this->screen->taxonomy . '_per_page' );
</ins><span class="cx">
</span><del>-                $tags_per_page = $this->get_items_per_page( 'edit_' . $taxonomy . '_per_page' );
-
-                if ( 'post_tag' == $taxonomy ) {
</del><ins>+                if ( 'post_tag' == $this->screen->taxonomy ) {
</ins><span class="cx">                         $tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page );
</span><span class="cx">                         $tags_per_page = apply_filters( 'tagsperpage', $tags_per_page ); // Old filter
</span><del>-                } elseif ( 'category' == $taxonomy ) {
</del><ins>+                } elseif ( 'category' == $this->screen->taxonomy ) {
</ins><span class="cx">                         $tags_per_page = apply_filters( 'edit_categories_per_page', $tags_per_page ); // Old filter
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -68,7 +69,7 @@
</span><span class="cx">                 $this->callback_args = $args;
</span><span class="cx">
</span><span class="cx">                 $this->set_pagination_args( array(
</span><del>-                        'total_items' => wp_count_terms( $taxonomy, compact( 'search' ) ),
</del><ins>+                        'total_items' => wp_count_terms( $this->screen->taxonomy, compact( 'search' ) ),
</ins><span class="cx">                         'per_page' => $tags_per_page,
</span><span class="cx">                 ) );
</span><span class="cx">         }
</span><span class="lines">@@ -93,8 +94,6 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function get_columns() {
</span><del>-                global $taxonomy, $post_type;
-
</del><span class="cx">                 $columns = array(
</span><span class="cx">                         'cb' => '<input type="checkbox" />',
</span><span class="cx">                         'name' => _x( 'Name', 'term name' ),
</span><span class="lines">@@ -102,10 +101,10 @@
</span><span class="cx">                         'slug' => __( 'Slug' ),
</span><span class="cx">                 );
</span><span class="cx">
</span><del>-                if ( 'link_category' == $taxonomy ) {
</del><ins>+                if ( 'link_category' == $this->screen->taxonomy ) {
</ins><span class="cx">                         $columns['links'] = __( 'Links' );
</span><span class="cx">                 } else {
</span><del>-                        $post_type_object = get_post_type_object( $post_type );
</del><ins>+                        $post_type_object = get_post_type_object( $this->screen->post_type );
</ins><span class="cx">                         $columns['posts'] = $post_type_object ? $post_type_object->labels->name : __( 'Posts' );
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -123,7 +122,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function display_rows_or_placeholder() {
</span><del>-                global $taxonomy;
</del><ins>+                $taxonomy = $this->screen->taxonomy;
</ins><span class="cx">
</span><span class="cx">                 $args = wp_parse_args( $this->callback_args, array(
</span><span class="cx">                         'page' => 1,
</span><span class="lines">@@ -231,11 +230,9 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function column_cb( $tag ) {
</span><del>-                global $taxonomy, $tax;
</del><ins>+                $default_term = get_option( 'default_' . $this->screen->taxonomy );
</ins><span class="cx">
</span><del>-                $default_term = get_option( 'default_' . $taxonomy );
-
-                if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term )
</del><ins>+                if ( current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->delete_terms ) && $tag->term_id != $default_term )
</ins><span class="cx">                         return '<label class="screen-reader-text" for="cb-select-' . $tag->term_id . '">' . sprintf( __( 'Select %s' ), $tag->name ) . '</label>'
</span><span class="cx">                                 . '<input type="checkbox" name="delete_tags[]" value="' . $tag->term_id . '" id="cb-select-' . $tag->term_id . '" />';
</span><span class="cx">
</span><span class="lines">@@ -243,14 +240,15 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function column_name( $tag ) {
</span><del>-                global $taxonomy, $tax, $post_type;
</del><ins>+                $taxonomy = $this->screen->taxonomy;
+                $tax = get_taxonomy( $taxonomy );
</ins><span class="cx">
</span><span class="cx">                 $default_term = get_option( 'default_' . $taxonomy );
</span><span class="cx">
</span><span class="cx">                 $pad = str_repeat( '&#8212; ', max( 0, $this->level ) );
</span><span class="cx">                 $name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag );
</span><span class="cx">                 $qe_data = get_term( $tag->term_id, $taxonomy, OBJECT, 'edit' );
</span><del>-                $edit_link = esc_url( get_edit_term_link( $tag->term_id, $taxonomy, $post_type ) );
</del><ins>+                $edit_link = esc_url( get_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type ) );
</ins><span class="cx">
</span><span class="cx">                 $out = '<strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $name ) ) . '">' . $name . '</a></strong><br />';
</span><span class="cx">
</span><span class="lines">@@ -284,13 +282,11 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function column_posts( $tag ) {
</span><del>-                global $taxonomy, $post_type;
-
</del><span class="cx">                 $count = number_format_i18n( $tag->count );
</span><span class="cx">
</span><del>-                $tax = get_taxonomy( $taxonomy );
</del><ins>+                $tax = get_taxonomy( $this->screen->taxonomy );
</ins><span class="cx">
</span><del>-                $ptype_object = get_post_type_object( $post_type );
</del><ins>+                $ptype_object = get_post_type_object( $this->screen->post_type );
</ins><span class="cx">                 if ( ! $ptype_object->show_ui )
</span><span class="cx">                         return $count;
</span><span class="cx">
</span><span class="lines">@@ -300,8 +296,8 @@
</span><span class="cx">                         $args = array( 'taxonomy' => $tax->name, 'term' => $tag->slug );
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if ( 'post' != $post_type )
-                        $args['post_type'] = $post_type;
</del><ins>+                if ( 'post' != $this->screen->post_type )
+                        $args['post_type'] = $this->screen->post_type;
</ins><span class="cx">
</span><span class="cx">                 return "<a href='" . esc_url ( add_query_arg( $args, 'edit.php' ) ) . "'>$count</a>";
</span><span class="cx">         }
</span><span class="lines">@@ -314,9 +310,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function column_default( $tag, $column_name ) {
</span><del>-                $screen = get_current_screen();
-
-                return apply_filters( "manage_{$screen->taxonomy}_custom_column", '', $column_name, $tag->term_id );
</del><ins>+                return apply_filters( "manage_{$this->screen->taxonomy}_custom_column", '', $column_name, $tag->term_id );
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /**
</span><span class="lines">@@ -325,7 +319,7 @@
</span><span class="cx">          * @since 3.1.0
</span><span class="cx">          */
</span><span class="cx">         function inline_edit() {
</span><del>-                global $post_type, $tax;
</del><ins>+                $tax = get_taxonomy( $this->screen->taxonomy );
</ins><span class="cx">
</span><span class="cx">                 if ( ! current_user_can( $tax->cap->edit_terms ) )
</span><span class="cx">                         return;
</span><span class="lines">@@ -358,7 +352,7 @@
</span><span class="cx">                         if ( isset( $core_columns[$column_name] ) )
</span><span class="cx">                                 continue;
</span><span class="cx">
</span><del>-                        do_action( 'quick_edit_custom_box', $column_name, 'edit-tags', $tax->name );
</del><ins>+                        do_action( 'quick_edit_custom_box', $column_name, 'edit-tags', $this->screen->taxonomy );
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">         ?>
</span><span class="lines">@@ -370,8 +364,8 @@
</span><span class="cx">                         <img class="waiting" style="display:none;" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
</span><span class="cx">                         <span class="error" style="display:none;"></span>
</span><span class="cx">                         <?php wp_nonce_field( 'taxinlineeditnonce', '_inline_edit', false ); ?>
</span><del>-                        <input type="hidden" name="taxonomy" value="<?php echo esc_attr( $tax->name ); ?>" />
-                        <input type="hidden" name="post_type" value="<?php echo esc_attr( $post_type ); ?>" />
</del><ins>+                        <input type="hidden" name="taxonomy" value="<?php echo esc_attr( $this->screen->taxonomy ); ?>" />
+                        <input type="hidden" name="post_type" value="<?php echo esc_attr( $this->screen->post_type ); ?>" />
</ins><span class="cx">                         <br class="clear" />
</span><span class="cx">                 </p>
</span><span class="cx">                 </td></tr>
</span></span></pre></div>
<a id="trunkwpadminincludesclasswpthemeslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-themes-list-table.php (21913 => 21914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-themes-list-table.php        2012-09-19 01:51:40 UTC (rev 21913)
+++ trunk/wp-admin/includes/class-wp-themes-list-table.php        2012-09-19 12:43:31 UTC (rev 21914)
</span><span class="lines">@@ -12,9 +12,10 @@
</span><span class="cx">         protected $search_terms = array();
</span><span class="cx">         var $features = array();
</span><span class="cx">
</span><del>-        function __construct() {
</del><ins>+        function __construct( $args = array() ) {
</ins><span class="cx">                 parent::__construct( array(
</span><span class="cx">                         'ajax' => true,
</span><ins>+                        'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
</ins><span class="cx">                 ) );
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminincludesclasswpuserslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-users-list-table.php (21913 => 21914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-users-list-table.php        2012-09-19 01:51:40 UTC (rev 21913)
+++ trunk/wp-admin/includes/class-wp-users-list-table.php        2012-09-19 12:43:31 UTC (rev 21914)
</span><span class="lines">@@ -12,17 +12,17 @@
</span><span class="cx">         var $site_id;
</span><span class="cx">         var $is_site_users;
</span><span class="cx">
</span><del>-        function __construct() {
-                $screen = get_current_screen();
-                $this->is_site_users = 'site-users-network' == $screen->id;
</del><ins>+        function __construct( $args = array() ) {
+                parent::__construct( array(
+                        'singular' => 'user',
+                        'plural' => 'users',
+                        'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
+                ) );
</ins><span class="cx">
</span><ins>+                $this->is_site_users = 'site-users-network' == $this->screen->id;
+
</ins><span class="cx">                 if ( $this->is_site_users )
</span><span class="cx">                         $this->site_id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
</span><del>-
-                parent::__construct( array(
-                        'singular' => 'user',
-                        'plural' => 'users'
-                ) );
</del><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function ajax_user_can() {
</span></span></pre></div>
<a id="trunkwpadminincludeslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/list-table.php (21913 => 21914)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/list-table.php        2012-09-19 01:51:40 UTC (rev 21913)
+++ trunk/wp-admin/includes/list-table.php        2012-09-19 12:43:31 UTC (rev 21914)
</span><span class="lines">@@ -14,9 +14,10 @@
</span><span class="cx"> * @since 3.1.0
</span><span class="cx"> *
</span><span class="cx"> * @param string $class The type of the list table, which is the class name.
</span><ins>+ * @param array $args Optional. Arguments to pass to the class. Accepts 'screen'.
</ins><span class="cx"> * @return object|bool Object on success, false if the class does not exist.
</span><span class="cx"> */
</span><del>-function _get_list_table( $class ) {
</del><ins>+function _get_list_table( $class, $args = array() ) {
</ins><span class="cx">         $core_classes = array(
</span><span class="cx">                 //Site Admin
</span><span class="cx">                 'WP_Posts_List_Table' => 'posts',
</span><span class="lines">@@ -39,7 +40,13 @@
</span><span class="cx">         if ( isset( $core_classes[ $class ] ) ) {
</span><span class="cx">                 foreach ( (array) $core_classes[ $class ] as $required )
</span><span class="cx">                         require_once( ABSPATH . 'wp-admin/includes/class-wp-' . $required . '-list-table.php' );
</span><del>-                return new $class;
</del><ins>+
+                if ( isset( $args['screen'] ) )
+                        $args['screen'] = convert_to_screen( $args['screen'] );
+                else
+                        $args['screen'] = get_current_screen();
+
+                return new $class( $args );
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         return false;
</span></span></pre>
</div>
</div>
</body>
</html>