<!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>[15807] trunk/wp-admin: Hook up theme filter.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/15807">15807</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-10-14 18:37:08 +0000 (Thu, 14 Oct 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Hook up theme filter. see <a href="http://trac.wordpress.org/ticket/14936">#14936</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesdefaultlisttablesphp">trunk/wp-admin/includes/default-list-tables.php</a></li>
<li><a href="#trunkwpadminthemesphp">trunk/wp-admin/themes.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesdefaultlisttablesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/default-list-tables.php (15806 => 15807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/default-list-tables.php        2010-10-14 15:09:04 UTC (rev 15806)
+++ trunk/wp-admin/includes/default-list-tables.php        2010-10-14 18:37:08 UTC (rev 15807)
</span><span class="lines">@@ -3870,7 +3870,7 @@
</span><span class="cx">                 if ( !current_user_can('switch_themes') &amp;&amp; !current_user_can('edit_theme_options') )
</span><span class="cx">                         wp_die( __( 'Cheatin&amp;#8217; uh?' ) );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function prepare_items() {
</span><span class="cx">                 global $ct;
</span><span class="cx"> 
</span><span class="lines">@@ -3880,9 +3880,19 @@
</span><span class="cx"> 
</span><span class="cx">                 $search = !empty( $_REQUEST['s'] ) ? trim( stripslashes( $_REQUEST['s'] ) ) : '';
</span><span class="cx"> 
</span><del>-                if ( '' !== $this-&gt;search ) {
</del><ins>+                if ( '' !== $search ) {
</ins><span class="cx">                         $this-&gt;search = array_merge( $this-&gt;search, array_filter( array_map( 'trim', explode( ',', $search ) ) ) );
</span><span class="cx">                         $this-&gt;search = array_unique( $this-&gt;search );
</span><ins>+                }
+
+                if ( !empty( $_REQUEST['features'] ) ) {
+                        $this-&gt;features = $_REQUEST['features'];
+                        $this-&gt;features = array_map( 'trim', $this-&gt;features );
+                        $this-&gt;features = array_map( 'sanitize_title_with_dashes', $this-&gt;features );
+                        $this-&gt;features = array_unique( $this-&gt;features );
+                }
+
+                if ( $this-&gt;search || $this-&gt;features ) {
</ins><span class="cx">                         foreach ( $themes as $key =&gt; $theme ) {
</span><span class="cx">                                 if ( !$this-&gt;search_theme( $theme ) )
</span><span class="cx">                                         unset( $themes[ $key ] );
</span></span></pre></div>
<a id="trunkwpadminthemesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/themes.php (15806 => 15807)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/themes.php        2010-10-14 15:09:04 UTC (rev 15806)
+++ trunk/wp-admin/themes.php        2010-10-14 18:37:08 UTC (rev 15807)
</span><span class="lines">@@ -142,7 +142,7 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;br class=&quot;clear&quot;/&gt;
</span><span class="cx"> 
</span><del>-&lt;div id=&quot;filters&quot; &lt;?php if ( ! isset( $tpage ) || $tpage != 'filter' ) echo ' style=&quot;display: none&quot;' ?&gt;&gt;
</del><ins>+&lt;div id=&quot;filters&quot; style=&quot;display: none;&quot;&gt;
</ins><span class="cx"> &lt;?php $feature_list = get_theme_feature_list(); ?&gt;
</span><span class="cx">         &lt;div class=&quot;feature-filter&quot;&gt;
</span><span class="cx">                 &lt;p class=&quot;install-help&quot;&gt;&lt;?php _e('Theme filters') ?&gt;&lt;/p&gt;
</span><span class="lines">@@ -160,7 +160,7 @@
</span><span class="cx">                                                 $feature = esc_attr($feature);
</span><span class="cx">                                                 ?&gt;
</span><span class="cx">                                 &lt;li&gt;
</span><del>-                                        &lt;input type=&quot;checkbox&quot; name=&quot;features[&lt;?php echo $key; ?&gt;]&quot; id=&quot;feature-id-&lt;?php echo $key; ?&gt;&quot; value=&quot;&lt;?php echo $key; ?&gt;&quot; &lt;?php checked( isset( $checked_features ) &amp;&amp; in_array( $key, $checked_features ) ); ?&gt;/&gt;
</del><ins>+                                        &lt;input type=&quot;checkbox&quot; name=&quot;features[&lt;?php echo $key; ?&gt;]&quot; id=&quot;feature-id-&lt;?php echo $key; ?&gt;&quot; value=&quot;&lt;?php echo $key; ?&gt;&quot; &lt;?php checked( in_array( $key, $wp_list_table-&gt;features ) ); ?&gt;/&gt;
</ins><span class="cx">                                         &lt;label for=&quot;feature-id-&lt;?php echo $key; ?&gt;&quot;&gt;&lt;?php echo $feature_name; ?&gt;&lt;/label&gt;
</span><span class="cx">                                 &lt;/li&gt;
</span><span class="cx">                                 &lt;?php endforeach; ?&gt;
</span></span></pre>
</div>
</div>

</body>
</html>