<!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( &quot;fetch-list-$list_class&quot;, '_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-&gt;is_network );
-        define( 'WP_USER_ADMIN', $current_screen-&gt;is_user );
-
-        $wp_list_table = _get_list_table( $list_class );
</del><ins>+        $wp_list_table = _get_list_table( $list_class, array( 'screen' =&gt; $_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-&gt;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' =&gt; $_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-&gt;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' =&gt; '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' =&gt; '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' =&gt; 'edit-comments' ) );
</ins><span class="cx">                         }
</span><span class="cx">                         $wp_list_table-&gt;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']) &amp;&amp; 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' =&gt; '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-&gt;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' =&gt; $_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-&gt;cap-&gt;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' =&gt; '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' =&gt; 'bookmarks',
</span><ins>+                        'screen' =&gt; 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' =&gt; '',
</span><span class="cx">                         'singular' =&gt; '',
</span><del>-                        'ajax' =&gt; false
</del><ins>+                        'ajax' =&gt; false,
+                        'screen' =&gt; null,
</ins><span class="cx">                 ) );
</span><span class="cx"> 
</span><del>-                $screen = get_current_screen();
</del><ins>+                $this-&gt;screen = convert_to_screen( $args['screen'] );
</ins><span class="cx"> 
</span><del>-                add_filter( &quot;manage_{$screen-&gt;id}_columns&quot;, array( &amp;$this, 'get_columns' ), 0 );
</del><ins>+                add_filter( &quot;manage_{$this-&gt;screen-&gt;id}_columns&quot;, array( &amp;$this, 'get_columns' ), 0 );
</ins><span class="cx"> 
</span><span class="cx">                 if ( !$args['plural'] )
</span><del>-                        $args['plural'] = $screen-&gt;base;
</del><ins>+                        $args['plural'] = $this-&gt;screen-&gt;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-&gt;get_views();
</span><del>-                $views = apply_filters( 'views_' . $screen-&gt;id, $views );
</del><ins>+                $views = apply_filters( 'views_' . $this-&gt;screen-&gt;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-&gt;_actions ) ) {
</span><span class="cx">                         $no_new_actions = $this-&gt;_actions = $this-&gt;get_bulk_actions();
</span><span class="cx">                         // This filter can currently only be used to remove actions.
</span><del>-                        $this-&gt;_actions = apply_filters( 'bulk_actions-' . $screen-&gt;id, $this-&gt;_actions );
</del><ins>+                        $this-&gt;_actions = apply_filters( 'bulk_actions-' . $this-&gt;screen-&gt;id, $this-&gt;_actions );
</ins><span class="cx">                         $this-&gt;_actions = array_intersect_assoc( $this-&gt;_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-&gt;_column_headers ) )
</span><span class="cx">                         return $this-&gt;_column_headers;
</span><span class="cx"> 
</span><del>-                $screen = get_current_screen();
</del><ins>+                $columns = get_column_headers( $this-&gt;screen );
+                $hidden = get_hidden_columns( $this-&gt;screen );
</ins><span class="cx"> 
</span><del>-                $columns = get_column_headers( $screen );
-                $hidden = get_hidden_columns( $screen );
</del><ins>+                $_sortable = apply_filters( &quot;manage_{$this-&gt;screen-&gt;id}_sortable_columns&quot;, $this-&gt;get_sortable_columns() );
</ins><span class="cx"> 
</span><del>-                $_sortable = apply_filters( &quot;manage_{$screen-&gt;id}_sortable_columns&quot;, $this-&gt;get_sortable_columns() );
-
</del><span class="cx">                 $sortable = array();
</span><span class="cx">                 foreach ( $_sortable as $id =&gt; $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-&gt;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'  =&gt; get_class( $this ),
</span><span class="cx">                         'screen' =&gt; array(
</span><del>-                                'id'   =&gt; $current_screen-&gt;id,
-                                'base' =&gt; $current_screen-&gt;base,
</del><ins>+                                'id'   =&gt; $this-&gt;screen-&gt;id,
+                                'base' =&gt; $this-&gt;screen-&gt;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-&gt;detached = isset( $_REQUEST['detached'] ) || isset( $_REQUEST['find_detached'] );
</span><span class="cx"> 
</span><span class="cx">                 parent::__construct( array(
</span><del>-                        'plural' =&gt; 'media'
</del><ins>+                        'plural' =&gt; 'media',
+                        'screen' =&gt; 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' =&gt; 'sites',
</span><ins>+                        'screen' =&gt; 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' =&gt; 'themes',
+                        'screen' =&gt; 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-&gt;get_pagenum();
</span><span class="cx"> 
</span><del>-                $screen = get_current_screen();
-                $this-&gt;is_site_themes = ( 'site-themes-network' == $screen-&gt;id ) ? true : false;
</del><ins>+                $this-&gt;is_site_themes = ( 'site-themes-network' == $this-&gt;screen-&gt;id ) ? true : false;
</ins><span class="cx"> 
</span><span class="cx">                 if ( $this-&gt;is_site_themes )
</span><span class="cx">                         $this-&gt;site_id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
</span><del>-
-                parent::__construct( array(
-                        'plural' =&gt; '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' =&gt; 'plugins',
+                        'screen' =&gt; isset( $args['screen'] ) ? $args['screen'] : null,
+                ) );
+
</ins><span class="cx">                 $status = 'all';
</span><span class="cx">                 if ( isset( $_REQUEST['plugin_status'] ) &amp;&amp; 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-&gt;get_pagenum();
</span><del>-
-                parent::__construct( array(
-                        'plural' =&gt; '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' =&gt; array()
</span><span class="cx">                 );
</span><span class="cx"> 
</span><del>-                $screen = get_current_screen();
</del><ins>+                $screen = $this-&gt;screen;
</ins><span class="cx"> 
</span><span class="cx">                 if ( ! is_multisite() || ( $screen-&gt;is_network &amp;&amp; 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-&gt;is_network &amp;&amp; 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-&gt;is_network &amp;&amp; isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated?
</del><ins>+                                if ( ! $screen-&gt;is_network &amp;&amp; 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-&gt;is_network ? __( 'Network Activate' ) : __( 'Activate' );
</del><ins>+                        $actions['activate-selected'] = $this-&gt;screen-&gt;is_network ? __( 'Network Activate' ) : __( 'Activate' );
</ins><span class="cx"> 
</span><span class="cx">                 if ( 'inactive' != $status &amp;&amp; 'recent' != $status )
</span><del>-                        $actions['deactivate-selected'] = $screen-&gt;is_network ? __( 'Network Deactivate' ) : __( 'Deactivate' );
</del><ins>+                        $actions['deactivate-selected'] = $this-&gt;screen-&gt;is_network ? __( 'Network Deactivate' ) : __( 'Deactivate' );
</ins><span class="cx"> 
</span><del>-                if ( !is_multisite() || $screen-&gt;is_network ) {
</del><ins>+                if ( !is_multisite() || $this-&gt;screen-&gt;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' ) &amp;&amp; ( 'active' != $status ) )
</span><span class="lines">@@ -271,9 +270,7 @@
</span><span class="cx"> 
</span><span class="cx">                 echo '&lt;div class=&quot;alignleft actions&quot;&gt;';
</span><span class="cx"> 
</span><del>-                $screen = get_current_screen();
-
-                if ( ! $screen-&gt;is_network &amp;&amp; 'recently_activated' == $status )
</del><ins>+                if ( ! $this-&gt;screen-&gt;is_network &amp;&amp; 'recently_activated' == $status )
</ins><span class="cx">                         submit_button( __( 'Clear List' ), 'small', 'clear-recent-list', false );
</span><span class="cx">                 elseif ( 'top' == $which &amp;&amp; 'mustuse' == $status )
</span><span class="cx">                         echo '&lt;p&gt;' . sprintf( __( 'Files in the &lt;code&gt;%s&lt;/code&gt; directory are executed automatically.' ), str_replace( ABSPATH, '/', WPMU_PLUGIN_DIR ) ) . '&lt;/p&gt;';
</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() &amp;&amp; !$screen-&gt;is_network &amp;&amp; in_array( $status, array( 'mustuse', 'dropins' ) ) )
</del><ins>+                if ( is_multisite() &amp;&amp; ! $this-&gt;screen-&gt;is_network &amp;&amp; in_array( $status, array( 'mustuse', 'dropins' ) ) )
</ins><span class="cx">                         return;
</span><span class="cx"> 
</span><span class="cx">                 foreach ( $this-&gt;items as $plugin_file =&gt; $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-&gt;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' =&gt; '',
</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()-&gt;post_type;
</del><ins>+                parent::__construct( array(
+                        'plural' =&gt; 'posts',
+                        'screen' =&gt; isset( $args['screen'] ) ? $args['screen'] : null,
+                ) );
+
+                $post_type = $this-&gt;screen-&gt;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-&gt;cap-&gt;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-&gt;sticky_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 ID IN ($sticky_posts)&quot;, $post_type ) );
</span><span class="cx">                 }
</span><del>-
-                parent::__construct( array(
-                        'plural' =&gt; '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-&gt;cap-&gt;edit_posts );
</del><ins>+                return current_user_can( get_post_type_object( $this-&gt;screen-&gt;post_type )-&gt;cap-&gt;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-&gt;hierarchical_display = ( $post_type_object-&gt;hierarchical &amp;&amp; 'menu_order title' == $wp_query-&gt;query['orderby'] );
</del><ins>+                $this-&gt;hierarchical_display = ( is_post_type_hierarchical( $this-&gt;screen-&gt;post_type ) &amp;&amp; 'menu_order title' == $wp_query-&gt;query['orderby'] );
</ins><span class="cx"> 
</span><span class="cx">                 $total_items = $this-&gt;hierarchical_display ? $wp_query-&gt;post_count : $wp_query-&gt;found_posts;
</span><span class="cx"> 
</span><del>-                $post_type = $post_type_object-&gt;name;
</del><ins>+                $post_type = $this-&gt;screen-&gt;post_type;
</ins><span class="cx">                 $per_page = $this-&gt;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'] ) &amp;&amp; 'trash' == $_REQUEST['post_status'] )
</span><del>-                        echo $post_type_object-&gt;labels-&gt;not_found_in_trash;
</del><ins>+                        echo get_post_type_object( $this-&gt;screen-&gt;post_type )-&gt;labels-&gt;not_found_in_trash;
</ins><span class="cx">                 else
</span><del>-                        echo $post_type_object-&gt;labels-&gt;not_found;
</del><ins>+                        echo get_post_type_object( $this-&gt;screen-&gt;post_type )-&gt;labels-&gt;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-&gt;name;
</del><ins>+                $post_type = $this-&gt;screen-&gt;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"> ?&gt;
</span><span class="cx">                 &lt;div class=&quot;alignleft actions&quot;&gt;
</span><span class="cx"> &lt;?php
</span><span class="cx">                 if ( 'top' == $which &amp;&amp; !is_singular() ) {
</span><span class="cx"> 
</span><del>-                        $this-&gt;months_dropdown( $post_type_object-&gt;name );
</del><ins>+                        $this-&gt;months_dropdown( $this-&gt;screen-&gt;post_type );
</ins><span class="cx"> 
</span><del>-                        if ( is_object_in_taxonomy( $post_type_object-&gt;name, 'category' ) ) {
</del><ins>+                        if ( is_object_in_taxonomy( $this-&gt;screen-&gt;post_type, 'category' ) ) {
</ins><span class="cx">                                 $dropdown_options = array(
</span><span class="cx">                                         'show_option_all' =&gt; __( 'View all categories' ),
</span><span class="cx">                                         'hide_empty' =&gt; 0,
</span><span class="lines">@@ -221,7 +218,7 @@
</span><span class="cx">                         submit_button( __( 'Filter' ), 'small', false, false, array( 'id' =&gt; 'post-query-submit' ) );
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                if ( $this-&gt;is_trash &amp;&amp; current_user_can( $post_type_object-&gt;cap-&gt;edit_others_posts ) ) {
</del><ins>+                if ( $this-&gt;is_trash &amp;&amp; current_user_can( get_post_type_object( $this-&gt;screen-&gt;post_type )-&gt;cap-&gt;edit_others_posts ) ) {
</ins><span class="cx">                         submit_button( __( 'Empty Trash' ), 'small apply', 'delete_all', false );
</span><span class="cx">                 }
</span><span class="cx"> ?&gt;
</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 &amp;&amp; !$post_type_object-&gt;hierarchical )
</del><ins>+                if ( 'top' == $which &amp;&amp; ! is_post_type_hierarchical( $this-&gt;screen-&gt;post_type ) )
</ins><span class="cx">                         $this-&gt;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-&gt;hierarchical ? 'pages' : 'posts' );
</del><ins>+                return array( 'widefat', 'fixed', is_post_type_hierarchical( $this-&gt;screen-&gt;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-&gt;screen-&gt;post_type;
</ins><span class="cx"> 
</span><del>-                if ( empty( $screen ) )
-                        $post_type = 'post';
-                else
-                        $post_type = $screen-&gt;post_type;
-
</del><span class="cx">                 $posts_columns = array();
</span><span class="cx"> 
</span><span class="cx">                 $posts_columns['cb'] = '&lt;input type=&quot;checkbox&quot; /&gt;';
</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-&gt;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-&gt;screen;
</ins><span class="cx"> 
</span><span class="cx">                 $post = get_default_post_to_edit( $screen-&gt;post_type );
</span><span class="cx">                 $post_type_object = get_post_type_object( $screen-&gt;post_type );
</span><span class="lines">@@ -733,8 +723,8 @@
</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;$hclass inline-edit-$screen-&gt;post_type &quot;;
-                        echo $bulk ? &quot;bulk-edit-row bulk-edit-row-$hclass bulk-edit-$screen-&gt;post_type&quot; : &quot;quick-edit-row quick-edit-row-$hclass inline-edit-$screen-&gt;post_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;$hclass inline-edit-&quot; . $screen-&gt;post_type;
+                        echo $bulk ? &quot;bulk-edit-row bulk-edit-row-$hclass bulk-edit-{$screen-&gt;post_type}&quot; : &quot;quick-edit-row quick-edit-row-$hclass inline-edit-{$screen-&gt;post_type}&quot;;
</ins><span class="cx">                 ?&gt;&quot; style=&quot;display: none&quot;&gt;&lt;td colspan=&quot;&lt;?php echo $this-&gt;get_column_count(); ?&gt;&quot; class=&quot;colspanchange&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></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' =&gt; 'tags',
+                        'singular' =&gt; 'tag',
+                        'screen' =&gt; isset( $args['screen'] ) ? $args['screen'] : null,
+                ) );
</ins><span class="cx"> 
</span><ins>+                $action    = $this-&gt;screen-&gt;action;
+                $post_type = $this-&gt;screen-&gt;post_type;
+                $taxonomy  = $this-&gt;screen-&gt;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' =&gt; true ) ) ) )
</span><span class="cx">                         $post_type = 'post';
</span><span class="cx"> 
</span><del>-                parent::__construct( array(
-                        'plural' =&gt; 'tags',
-                        'singular' =&gt; '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-&gt;cap-&gt;manage_terms );
</del><ins>+                return current_user_can( get_taxonomy( $this-&gt;screen-&gt;taxonomy )-&gt;cap-&gt;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-&gt;get_items_per_page( 'edit_' . $this-&gt;screen-&gt;taxonomy . '_per_page' );
</ins><span class="cx"> 
</span><del>-                $tags_per_page = $this-&gt;get_items_per_page( 'edit_' . $taxonomy . '_per_page' );
-
-                if ( 'post_tag' == $taxonomy ) {
</del><ins>+                if ( 'post_tag' == $this-&gt;screen-&gt;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-&gt;screen-&gt;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-&gt;callback_args = $args;
</span><span class="cx"> 
</span><span class="cx">                 $this-&gt;set_pagination_args( array(
</span><del>-                        'total_items' =&gt; wp_count_terms( $taxonomy, compact( 'search' ) ),
</del><ins>+                        'total_items' =&gt; wp_count_terms( $this-&gt;screen-&gt;taxonomy, compact( 'search' ) ),
</ins><span class="cx">                         'per_page' =&gt; $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'          =&gt; '&lt;input type=&quot;checkbox&quot; /&gt;',
</span><span class="cx">                         'name'        =&gt; _x( 'Name', 'term name' ),
</span><span class="lines">@@ -102,10 +101,10 @@
</span><span class="cx">                         'slug'        =&gt; __( 'Slug' ),
</span><span class="cx">                 );
</span><span class="cx"> 
</span><del>-                if ( 'link_category' == $taxonomy ) {
</del><ins>+                if ( 'link_category' == $this-&gt;screen-&gt;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-&gt;screen-&gt;post_type );
</ins><span class="cx">                         $columns['posts'] = $post_type_object ? $post_type_object-&gt;labels-&gt;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-&gt;screen-&gt;taxonomy;
</ins><span class="cx"> 
</span><span class="cx">                 $args = wp_parse_args( $this-&gt;callback_args, array(
</span><span class="cx">                         'page' =&gt; 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-&gt;screen-&gt;taxonomy );
</ins><span class="cx"> 
</span><del>-                $default_term = get_option( 'default_' . $taxonomy );
-
-                if ( current_user_can( $tax-&gt;cap-&gt;delete_terms ) &amp;&amp; $tag-&gt;term_id != $default_term )
</del><ins>+                if ( current_user_can( get_taxonomy( $this-&gt;screen-&gt;taxonomy )-&gt;cap-&gt;delete_terms ) &amp;&amp; $tag-&gt;term_id != $default_term )
</ins><span class="cx">                         return '&lt;label class=&quot;screen-reader-text&quot; for=&quot;cb-select-' . $tag-&gt;term_id . '&quot;&gt;' . sprintf( __( 'Select %s' ), $tag-&gt;name ) . '&lt;/label&gt;'
</span><span class="cx">                                 . '&lt;input type=&quot;checkbox&quot; name=&quot;delete_tags[]&quot; value=&quot;' . $tag-&gt;term_id . '&quot; id=&quot;cb-select-' . $tag-&gt;term_id . '&quot; /&gt;';
</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-&gt;screen-&gt;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( '&amp;#8212; ', max( 0, $this-&gt;level ) );
</span><span class="cx">                 $name = apply_filters( 'term_name', $pad . ' ' . $tag-&gt;name, $tag );
</span><span class="cx">                 $qe_data = get_term( $tag-&gt;term_id, $taxonomy, OBJECT, 'edit' );
</span><del>-                $edit_link = esc_url( get_edit_term_link( $tag-&gt;term_id, $taxonomy, $post_type ) );
</del><ins>+                $edit_link = esc_url( get_edit_term_link( $tag-&gt;term_id, $taxonomy, $this-&gt;screen-&gt;post_type ) );
</ins><span class="cx"> 
</span><span class="cx">                 $out = '&lt;strong&gt;&lt;a class=&quot;row-title&quot; href=&quot;' . $edit_link . '&quot; title=&quot;' . esc_attr( sprintf( __( 'Edit &amp;#8220;%s&amp;#8221;' ), $name ) ) . '&quot;&gt;' . $name . '&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;';
</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-&gt;count );
</span><span class="cx"> 
</span><del>-                $tax = get_taxonomy( $taxonomy );
</del><ins>+                $tax = get_taxonomy( $this-&gt;screen-&gt;taxonomy );
</ins><span class="cx"> 
</span><del>-                $ptype_object = get_post_type_object( $post_type );
</del><ins>+                $ptype_object = get_post_type_object( $this-&gt;screen-&gt;post_type );
</ins><span class="cx">                 if ( ! $ptype_object-&gt;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' =&gt; $tax-&gt;name, 'term' =&gt; $tag-&gt;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-&gt;screen-&gt;post_type )
+                        $args['post_type'] = $this-&gt;screen-&gt;post_type;
</ins><span class="cx"> 
</span><span class="cx">                 return &quot;&lt;a href='&quot; . esc_url ( add_query_arg( $args, 'edit.php' ) ) . &quot;'&gt;$count&lt;/a&gt;&quot;;
</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( &quot;manage_{$screen-&gt;taxonomy}_custom_column&quot;, '', $column_name, $tag-&gt;term_id );
</del><ins>+                return apply_filters( &quot;manage_{$this-&gt;screen-&gt;taxonomy}_custom_column&quot;, '', $column_name, $tag-&gt;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-&gt;screen-&gt;taxonomy );
</ins><span class="cx"> 
</span><span class="cx">                 if ( ! current_user_can( $tax-&gt;cap-&gt;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-&gt;name );
</del><ins>+                        do_action( 'quick_edit_custom_box', $column_name, 'edit-tags', $this-&gt;screen-&gt;taxonomy );
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">         ?&gt;
</span><span class="lines">@@ -370,8 +364,8 @@
</span><span class="cx">                         &lt;img class=&quot;waiting&quot; style=&quot;display:none;&quot; src=&quot;&lt;?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?&gt;&quot; alt=&quot;&quot; /&gt;
</span><span class="cx">                         &lt;span class=&quot;error&quot; style=&quot;display:none;&quot;&gt;&lt;/span&gt;
</span><span class="cx">                         &lt;?php wp_nonce_field( 'taxinlineeditnonce', '_inline_edit', false ); ?&gt;
</span><del>-                        &lt;input type=&quot;hidden&quot; name=&quot;taxonomy&quot; value=&quot;&lt;?php echo esc_attr( $tax-&gt;name ); ?&gt;&quot; /&gt;
-                        &lt;input type=&quot;hidden&quot; name=&quot;post_type&quot; value=&quot;&lt;?php echo esc_attr( $post_type ); ?&gt;&quot; /&gt;
</del><ins>+                        &lt;input type=&quot;hidden&quot; name=&quot;taxonomy&quot; value=&quot;&lt;?php echo esc_attr( $this-&gt;screen-&gt;taxonomy ); ?&gt;&quot; /&gt;
+                        &lt;input type=&quot;hidden&quot; name=&quot;post_type&quot; value=&quot;&lt;?php echo esc_attr( $this-&gt;screen-&gt;post_type ); ?&gt;&quot; /&gt;
</ins><span class="cx">                         &lt;br class=&quot;clear&quot; /&gt;
</span><span class="cx">                 &lt;/p&gt;
</span><span class="cx">                 &lt;/td&gt;&lt;/tr&gt;
</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' =&gt; true,
</span><ins>+                        'screen' =&gt; 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-&gt;is_site_users = 'site-users-network' == $screen-&gt;id;
</del><ins>+        function __construct( $args = array() ) {
+                parent::__construct( array(
+                        'singular' =&gt; 'user',
+                        'plural'   =&gt; 'users',
+                        'screen'   =&gt; isset( $args['screen'] ) ? $args['screen'] : null,
+                ) );
</ins><span class="cx"> 
</span><ins>+                $this-&gt;is_site_users = 'site-users-network' == $this-&gt;screen-&gt;id;
+
</ins><span class="cx">                 if ( $this-&gt;is_site_users )
</span><span class="cx">                         $this-&gt;site_id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
</span><del>-
-                parent::__construct( array(
-                        'singular' =&gt; 'user',
-                        'plural'   =&gt; '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' =&gt; '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>