<!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>[16125] trunk/wp-admin/includes:
  Make the class to filename mapping easier to read.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/16125">16125</a></dd>
<dt>Author</dt> <dd>westi</dd>
<dt>Date</dt> <dd>2010-11-01 08:37:02 +0000 (Mon, 01 Nov 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make the class to filename mapping easier to read.
Ensure that we support PHP4 for now by passing references to objects in list tables code.
See <a href="http://trac.wordpress.org/ticket/14579">#14579</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesclasswplisttablephp">trunk/wp-admin/includes/class-wp-list-table.php</a></li>
<li><a href="#trunkwpadminincludeslisttablemsthemesphp">trunk/wp-admin/includes/list-table-ms-themes.php</a></li>
<li><a href="#trunkwpadminincludeslisttablepluginsphp">trunk/wp-admin/includes/list-table-plugins.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesclasswplisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-list-table.php (16124 => 16125)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-list-table.php        2010-11-01 08:23:02 UTC (rev 16124)
+++ trunk/wp-admin/includes/class-wp-list-table.php        2010-11-01 08:37:02 UTC (rev 16125)
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx">                 if ( is_string( $this-&gt;_screen ) )
</span><span class="cx">                         $this-&gt;_screen = convert_to_screen( $this-&gt;_screen );
</span><span class="cx"> 
</span><del>-                add_filter( 'manage_' . $this-&gt;_screen-&gt;id . '_columns', array( $this, 'get_columns' ), 0 );
</del><ins>+                add_filter( 'manage_' . $this-&gt;_screen-&gt;id . '_columns', array( &amp;$this, 'get_columns' ), 0 );
</ins><span class="cx"> 
</span><span class="cx">                 if ( !$args['plural'] )
</span><span class="cx">                         $args['plural'] = $this-&gt;_screen-&gt;base;
</span><span class="lines">@@ -98,7 +98,7 @@
</span><span class="cx"> 
</span><span class="cx">                 if ( $args['ajax'] ) {
</span><span class="cx">                         wp_enqueue_script( 'list-table' );
</span><del>-                        add_action( 'admin_footer', array( $this, '_js_vars' ) );
</del><ins>+                        add_action( 'admin_footer', array( &amp;$this, '_js_vars' ) );
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -762,7 +762,7 @@
</span><span class="cx">                         }
</span><span class="cx">                         elseif ( method_exists( $this, 'column_' . $column_name ) ) {
</span><span class="cx">                                 echo &quot;&lt;td $attributes&gt;&quot;;
</span><del>-                                echo call_user_func( array( $this, 'column_' . $column_name ), $item );
</del><ins>+                                echo call_user_func( array( &amp;$this, 'column_' . $column_name ), $item );
</ins><span class="cx">                                 echo &quot;&lt;/td&gt;&quot;;
</span><span class="cx">                         }
</span><span class="cx">                         else {
</span><span class="lines">@@ -846,11 +846,22 @@
</span><span class="cx">  * @return bool True on success, false on failure.
</span><span class="cx">  */
</span><span class="cx"> function require_list_table( $class ) {
</span><del>-        $core_classes = array( 'WP_Posts_Table' =&gt; 'posts', 'WP_Media_Table' =&gt; 'media', 'WP_Terms_Table' =&gt; 'terms',
-                'WP_Users_Table' =&gt; 'users', 'WP_Comments_Table' =&gt; 'comments', 'WP_Post_Comments_Table' =&gt; 'comments',
-                'WP_Links_Table' =&gt; 'links', 'WP_Sites_Table' =&gt; 'sites', 'WP_MS_Users_Table' =&gt; 'ms-users',
-                'WP_Plugins_Table' =&gt; 'plugins', 'WP_Plugin_Install_Table' =&gt; 'plugin-install', 'WP_Themes_Table' =&gt; 'themes',
-                'WP_Theme_Install_Table' =&gt; 'theme-install', 'WP_MS_Themes_Table' =&gt; 'ms-themes' );
</del><ins>+        $core_classes = array(
+                'WP_Posts_Table' =&gt; 'posts',
+                'WP_Media_Table' =&gt; 'media',
+                'WP_Terms_Table' =&gt; 'terms',
+                'WP_Users_Table' =&gt; 'users',
+                'WP_Comments_Table' =&gt; 'comments',
+                'WP_Post_Comments_Table' =&gt; 'comments',
+                'WP_Links_Table' =&gt; 'links',
+                'WP_Sites_Table' =&gt; 'sites',
+                'WP_MS_Users_Table' =&gt; 'ms-users',
+                'WP_Plugins_Table' =&gt; 'plugins',
+                'WP_Plugin_Install_Table' =&gt; 'plugin-install',
+                'WP_Themes_Table' =&gt; 'themes',
+                'WP_Theme_Install_Table' =&gt; 'theme-install',
+                'WP_MS_Themes_Table' =&gt; 'ms-themes',
+        );
</ins><span class="cx"> 
</span><span class="cx">         if ( isset( $core_classes[ $class ] ) ) {
</span><span class="cx">                 require_once( ABSPATH . '/wp-admin/includes/list-table-' . $core_classes[ $class ] . '.php' );
</span></span></pre></div>
<a id="trunkwpadminincludeslisttablemsthemesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/list-table-ms-themes.php (16124 => 16125)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/list-table-ms-themes.php        2010-11-01 08:23:02 UTC (rev 16124)
+++ trunk/wp-admin/includes/list-table-ms-themes.php        2010-11-01 08:37:02 UTC (rev 16125)
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx"> 
</span><span class="cx">                 if ( $s ) {
</span><span class="cx">                         $status = 'search';
</span><del>-                        $themes['search'] = array_filter( $themes['all'], array( $this, '_search_callback' ) );
</del><ins>+                        $themes['search'] = array_filter( $themes['all'], array( &amp;$this, '_search_callback' ) );
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 $totals = array();
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx">                         $orderby = ucfirst( $orderby );
</span><span class="cx">                         $order = strtoupper( $order );
</span><span class="cx"> 
</span><del>-                        uasort( $this-&gt;items, array( $this, '_order_callback' ) );
</del><ins>+                        uasort( $this-&gt;items, array( &amp;$this, '_order_callback' ) );
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 $themes_per_page = $this-&gt;get_items_per_page( 'themes_per_page', 999 );
</span></span></pre></div>
<a id="trunkwpadminincludeslisttablepluginsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/list-table-plugins.php (16124 => 16125)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/list-table-plugins.php        2010-11-01 08:23:02 UTC (rev 16124)
+++ trunk/wp-admin/includes/list-table-plugins.php        2010-11-01 08:37:02 UTC (rev 16125)
</span><span class="lines">@@ -109,7 +109,7 @@
</span><span class="cx"> 
</span><span class="cx">                 if ( $s ) {
</span><span class="cx">                         $status = 'search';
</span><del>-                        $plugins['search'] = array_filter( $plugins['all'], array( $this, '_search_callback' ) );
</del><ins>+                        $plugins['search'] = array_filter( $plugins['all'], array( &amp;$this, '_search_callback' ) );
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 $totals = array();
</span><span class="lines">@@ -126,7 +126,7 @@
</span><span class="cx">                         $orderby = ucfirst( $orderby );
</span><span class="cx">                         $order = strtoupper( $order );
</span><span class="cx"> 
</span><del>-                        uasort( $this-&gt;items, array( $this, '_order_callback' ) );
</del><ins>+                        uasort( $this-&gt;items, array( &amp;$this, '_order_callback' ) );
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 $plugins_per_page = $this-&gt;get_items_per_page( 'plugins_per_page', 999 );
</span></span></pre>
</div>
</div>

</body>
</html>