<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[16182] trunk/wp-admin/includes: Default to get_current_screen()
in list table classes.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/16182">16182</a></dd>
<dt>Author</dt> <dd>scribu</dd>
<dt>Date</dt> <dd>2010-11-04 15:00:55 +0000 (Thu, 04 Nov 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Default to get_current_screen() in list table classes. See <a href="http://trac.wordpress.org/ticket/14579">#14579</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesclasswpcommentslisttablephp">trunk/wp-admin/includes/class-wp-comments-list-table.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="#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="#trunkwpadminincludesclasswpmsuserslisttablephp">trunk/wp-admin/includes/class-wp-ms-users-list-table.php</a></li>
<li><a href="#trunkwpadminincludesclasswpplugininstalllisttablephp">trunk/wp-admin/includes/class-wp-plugin-install-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="#trunkwpadminincludesclasswpthemeinstalllisttablephp">trunk/wp-admin/includes/class-wp-theme-install-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="#trunkwpadminincludesdeprecatedphp">trunk/wp-admin/includes/deprecated.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesclasswpcommentslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-comments-list-table.php (16181 => 16182)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-comments-list-table.php        2010-11-04 14:43:10 UTC (rev 16181)
+++ trunk/wp-admin/includes/class-wp-comments-list-table.php        2010-11-04 15:00:55 UTC (rev 16182)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx">                         add_filter( 'comment_author', 'floated_admin_avatar' );
</span><span class="cx">
</span><span class="cx">                 parent::WP_List_Table( array(
</span><del>-                        'screen' => 'edit-comments',
</del><span class="cx">                         'plural' => 'comments'
</span><span class="cx">                 ) );
</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 (16181 => 16182)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-links-list-table.php        2010-11-04 14:43:10 UTC (rev 16181)
+++ trunk/wp-admin/includes/class-wp-links-list-table.php        2010-11-04 15:00:55 UTC (rev 16182)
</span><span class="lines">@@ -10,7 +10,6 @@
</span><span class="cx">
</span><span class="cx">         function WP_Links_List_Table() {
</span><span class="cx">                 parent::WP_List_Table( array(
</span><del>-                        'screen' => 'link-manager',
</del><span class="cx">                         'plural' => 'bookmarks',
</span><span class="cx">                 ) );
</span><span class="cx">         }
</span><span class="lines">@@ -189,4 +188,4 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-?>
</del><span class="cx">\ No newline at end of file
</span><ins>+?>
</ins></span></pre></div>
<a id="trunkwpadminincludesclasswplisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-list-table.php (16181 => 16182)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-list-table.php        2010-11-04 14:43:10 UTC (rev 16181)
+++ trunk/wp-admin/includes/class-wp-list-table.php        2010-11-04 15:00:55 UTC (rev 16182)
</span><span class="lines">@@ -76,9 +76,9 @@
</span><span class="cx">          * @param array $args An associative array with information about the current table
</span><span class="cx">          * @access protected
</span><span class="cx">          */
</span><del>-        function WP_List_Table( $args ) {
</del><ins>+        function WP_List_Table( $args = array() ) {
</ins><span class="cx">                 $args = wp_parse_args( $args, array(
</span><del>-                        'screen' => '',
</del><ins>+                        'screen' => get_current_screen(),
</ins><span class="cx">                         'plural' => '',
</span><span class="cx">                         'singular' => '',
</span><span class="cx">                         'ajax' => true
</span><span class="lines">@@ -632,9 +632,7 @@
</span><span class="cx">          * @return array
</span><span class="cx">          */
</span><span class="cx">         function get_table_classes() {
</span><del>-                extract( $this->_args );
-
-                return array( 'widefat', 'fixed', $plural );
</del><ins>+                return array( 'widefat', 'fixed', $this->_args['plural'] );
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /**
</span><span class="lines">@@ -807,13 +805,12 @@
</span><span class="cx">          * @access private
</span><span class="cx">          */
</span><span class="cx">         function _js_vars() {
</span><del>-                extract( $this->_args );
-
-                $class = get_class( $this );
-
-                printf( "<script type='text/javascript'>list_args = %s;</script>\n",
-                        json_encode( compact( 'screen', 'class' ) )
</del><ins>+                $args = array(
+                        'class' => get_class( $this ),
+                        'screen' => $this->_screen
</ins><span class="cx">                 );
</span><ins>+
+                printf( "<script type='text/javascript'>list_args = %s;</script>\n", json_encode( $args ) );
</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 (16181 => 16182)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-ms-sites-list-table.php        2010-11-04 14:43:10 UTC (rev 16181)
+++ trunk/wp-admin/includes/class-wp-ms-sites-list-table.php        2010-11-04 15:00:55 UTC (rev 16182)
</span><span class="lines">@@ -10,7 +10,6 @@
</span><span class="cx">
</span><span class="cx">         function WP_MS_Sites_List_Table() {
</span><span class="cx">                 parent::WP_List_Table( array(
</span><del>-                        'screen' => 'sites-network',
</del><span class="cx">                         'plural' => 'sites',
</span><span class="cx">                 ) );
</span><span class="cx">         }
</span><span class="lines">@@ -330,4 +329,4 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-?>
</del><span class="cx">\ No newline at end of file
</span><ins>+?>
</ins></span></pre></div>
<a id="trunkwpadminincludesclasswpmsthemeslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-ms-themes-list-table.php (16181 => 16182)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-ms-themes-list-table.php        2010-11-04 14:43:10 UTC (rev 16181)
+++ trunk/wp-admin/includes/class-wp-ms-themes-list-table.php        2010-11-04 15:00:55 UTC (rev 16182)
</span><span class="lines">@@ -23,7 +23,6 @@
</span><span class="cx">                 $page = $this->get_pagenum();
</span><span class="cx">
</span><span class="cx">                 parent::WP_List_Table( array(
</span><del>-                        'screen' => 'themes',
</del><span class="cx">                         'plural' => 'plugins', // @todo replace with themes and add css
</span><span class="cx">                 ) );
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkwpadminincludesclasswpmsuserslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-ms-users-list-table.php (16181 => 16182)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-ms-users-list-table.php        2010-11-04 14:43:10 UTC (rev 16181)
+++ trunk/wp-admin/includes/class-wp-ms-users-list-table.php        2010-11-04 15:00:55 UTC (rev 16182)
</span><span class="lines">@@ -10,7 +10,7 @@
</span><span class="cx">
</span><span class="cx">         function WP_MS_Users_List_Table() {
</span><span class="cx">                 parent::WP_List_Table( array(
</span><del>-                        'screen' => 'users-network',
</del><ins>+                        'plural' => 'users'
</ins><span class="cx">                 ) );
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -234,4 +234,4 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-?>
</del><span class="cx">\ No newline at end of file
</span><ins>+?>
</ins></span></pre></div>
<a id="trunkwpadminincludesclasswpplugininstalllisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-plugin-install-list-table.php (16181 => 16182)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-plugin-install-list-table.php        2010-11-04 14:43:10 UTC (rev 16181)
+++ trunk/wp-admin/includes/class-wp-plugin-install-list-table.php        2010-11-04 15:00:55 UTC (rev 16182)
</span><span class="lines">@@ -8,12 +8,6 @@
</span><span class="cx"> */
</span><span class="cx"> class WP_Plugin_Install_List_Table extends WP_List_Table {
</span><span class="cx">
</span><del>-        function WP_Plugin_Install_List_Table() {
-                parent::WP_List_Table( array(
-                        'screen' => 'plugin-install',
-                ) );
-        }
-
</del><span class="cx">         function check_permissions() {
</span><span class="cx">                 if ( ! current_user_can('install_plugins') )
</span><span class="cx">                         wp_die(__('You do not have sufficient permissions to install plugins on this site.'));
</span><span class="lines">@@ -231,4 +225,4 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-?>
</del><span class="cx">\ No newline at end of file
</span><ins>+?>
</ins></span></pre></div>
<a id="trunkwpadminincludesclasswppluginslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-plugins-list-table.php (16181 => 16182)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-plugins-list-table.php        2010-11-04 14:43:10 UTC (rev 16181)
+++ trunk/wp-admin/includes/class-wp-plugins-list-table.php        2010-11-04 15:00:55 UTC (rev 16182)
</span><span class="lines">@@ -23,7 +23,6 @@
</span><span class="cx">                 $page = $this->get_pagenum();
</span><span class="cx">
</span><span class="cx">                 parent::WP_List_Table( array(
</span><del>-                        'screen' => 'plugins',
</del><span class="cx">                         'plural' => 'plugins',
</span><span class="cx">                 ) );
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkwpadminincludesclasswppostslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-posts-list-table.php (16181 => 16182)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-posts-list-table.php        2010-11-04 14:43:10 UTC (rev 16181)
+++ trunk/wp-admin/includes/class-wp-posts-list-table.php        2010-11-04 15:00:55 UTC (rev 16182)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx">         var $sticky_posts_count = 0;
</span><span class="cx">
</span><span class="cx">         function WP_Posts_List_Table() {
</span><del>-                global $post_type_object, $post_type, $current_screen, $wpdb;
</del><ins>+                global $post_type_object, $post_type, $wpdb;
</ins><span class="cx">
</span><span class="cx">                 if ( !isset( $_REQUEST['post_type'] ) )
</span><span class="cx">                         $post_type = 'post';
</span><span class="lines">@@ -74,7 +74,6 @@
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 parent::WP_List_Table( array(
</span><del>-                        'screen' => $current_screen,
</del><span class="cx">                         'plural' => 'posts',
</span><span class="cx">                 ) );
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkwpadminincludesclasswptermslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-terms-list-table.php (16181 => 16182)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-terms-list-table.php        2010-11-04 14:43:10 UTC (rev 16181)
+++ trunk/wp-admin/includes/class-wp-terms-list-table.php        2010-11-04 15:00:55 UTC (rev 16182)
</span><span class="lines">@@ -11,7 +11,7 @@
</span><span class="cx">         var $callback_args;
</span><span class="cx">
</span><span class="cx">         function WP_Terms_List_Table() {
</span><del>-                global $post_type, $taxonomy, $tax, $current_screen;
</del><ins>+                global $post_type, $taxonomy, $tax;
</ins><span class="cx">
</span><span class="cx">                 wp_reset_vars( array( 'action', 'taxonomy', 'post_type' ) );
</span><span class="cx">
</span><span class="lines">@@ -26,11 +26,7 @@
</span><span class="cx">                 if ( empty( $post_type ) || !in_array( $post_type, get_post_types( array( 'public' => true ) ) ) )
</span><span class="cx">                         $post_type = 'post';
</span><span class="cx">
</span><del>-                if ( !isset( $current_screen ) )
-                        set_current_screen( 'edit-' . $taxonomy );
-
</del><span class="cx">                 parent::WP_List_Table( array(
</span><del>-                        'screen' => $current_screen,
</del><span class="cx">                         'plural' => 'tags',
</span><span class="cx">                         'singular' => 'tag',
</span><span class="cx">                 ) );
</span><span class="lines">@@ -362,4 +358,4 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-?>
</del><span class="cx">\ No newline at end of file
</span><ins>+?>
</ins></span></pre></div>
<a id="trunkwpadminincludesclasswpthemeinstalllisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-theme-install-list-table.php (16181 => 16182)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-theme-install-list-table.php        2010-11-04 14:43:10 UTC (rev 16181)
+++ trunk/wp-admin/includes/class-wp-theme-install-list-table.php        2010-11-04 15:00:55 UTC (rev 16182)
</span><span class="lines">@@ -8,12 +8,6 @@
</span><span class="cx"> */
</span><span class="cx"> class WP_Theme_Install_List_Table extends WP_List_Table {
</span><span class="cx">
</span><del>-        function WP_Theme_Install_List_Table() {
-                parent::WP_List_Table( array(
-                        'screen' => 'theme-install',
-                ) );
-        }
-
</del><span class="cx">         function check_permissions() {
</span><span class="cx">                 if ( ! current_user_can('install_themes') )
</span><span class="cx">                         wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) );
</span><span class="lines">@@ -184,4 +178,4 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-?>
</del><span class="cx">\ No newline at end of file
</span><ins>+?>
</ins></span></pre></div>
<a id="trunkwpadminincludesclasswpthemeslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-themes-list-table.php (16181 => 16182)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-themes-list-table.php        2010-11-04 14:43:10 UTC (rev 16181)
+++ trunk/wp-admin/includes/class-wp-themes-list-table.php        2010-11-04 15:00:55 UTC (rev 16182)
</span><span class="lines">@@ -11,12 +11,6 @@
</span><span class="cx">         var $search = array();
</span><span class="cx">         var $features = array();
</span><span class="cx">
</span><del>-        function WP_Themes_List_Table() {
-                parent::__construct( array(
-                        'screen' => 'themes',
-                ) );
-        }
-
</del><span class="cx">         function check_permissions() {
</span><span class="cx">                 if ( !current_user_can('switch_themes') && !current_user_can('edit_theme_options') )
</span><span class="cx">                         wp_die( __( 'Cheatin&#8217; uh?' ) );
</span><span class="lines">@@ -216,4 +210,4 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-?>
</del><span class="cx">\ No newline at end of file
</span><ins>+?>
</ins></span></pre></div>
<a id="trunkwpadminincludesclasswpuserslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-users-list-table.php (16181 => 16182)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-users-list-table.php        2010-11-04 14:43:10 UTC (rev 16181)
+++ trunk/wp-admin/includes/class-wp-users-list-table.php        2010-11-04 15:00:55 UTC (rev 16182)
</span><span class="lines">@@ -8,13 +8,6 @@
</span><span class="cx"> */
</span><span class="cx"> class WP_Users_List_Table extends WP_List_Table {
</span><span class="cx">
</span><del>-        function WP_Users_List_Table() {
-                parent::WP_List_Table( array(
-                        'screen' => 'users',
-                        'plural' => 'users'
-                ) );
-        }
-
</del><span class="cx">         function check_permissions() {
</span><span class="cx">                 if ( !current_user_can('list_users') )
</span><span class="cx">                         wp_die(__('Cheatin&#8217; uh?'));
</span><span class="lines">@@ -275,4 +268,4 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-?>
</del><span class="cx">\ No newline at end of file
</span><ins>+?>
</ins></span></pre></div>
<a id="trunkwpadminincludesdeprecatedphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/deprecated.php (16181 => 16182)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/deprecated.php        2010-11-04 14:43:10 UTC (rev 16181)
+++ trunk/wp-admin/includes/deprecated.php        2010-11-04 15:00:55 UTC (rev 16182)
</span><span class="lines">@@ -731,7 +731,7 @@
</span><span class="cx">
</span><span class="cx">         var $_columns = array();
</span><span class="cx">
</span><del>-        function _WP_List_Table_Compat( $screen) {
</del><ins>+        function _WP_List_Table_Compat( $screen ) {
</ins><span class="cx">                 parent::WP_List_Table( array(
</span><span class="cx">                         'screen' => $screen,
</span><span class="cx">                         'ajax' => false
</span></span></pre>
</div>
</div>
</body>
</html>