<!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>[13008] trunk/wp-admin/includes/template.php: Remove cat_rows()
  admin template functions.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/13008">13008</a></dd>
<dt>Author</dt> <dd>dd32</dd>
<dt>Date</dt> <dd>2010-02-07 05:54:33 +0000 (Sun, 07 Feb 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove cat_rows() admin template functions. See <a href="http://trac.wordpress.org/ticket/11838">#11838</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludestemplatephp">trunk/wp-admin/includes/template.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludestemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/template.php (13007 => 13008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/template.php        2010-02-07 05:07:36 UTC (rev 13007)
+++ trunk/wp-admin/includes/template.php        2010-02-07 05:54:33 UTC (rev 13008)
</span><span class="lines">@@ -8,199 +8,9 @@
</span><span class="cx">  * @subpackage Administration
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-// Ugly recursive category stuff.
</del><span class="cx"> /**
</span><span class="cx">  * {@internal Missing Short Description}}
</span><span class="cx">  *
</span><del>- * @since unknown
- *
- * @param unknown_type $parent
- * @param unknown_type $level
- * @param unknown_type $categories
- * @param unknown_type $page
- * @param unknown_type $per_page
- */
-function cat_rows( $parent = 0, $level = 0, $categories = 0, $page = 1, $per_page = 20, $taxonomy = 'category' ) {
-
-        $count = 0;
-
-        if ( empty($categories) ) {
-
-                $args = array('hide_empty' =&gt; 0, 'taxonomy' =&gt; $taxonomy);
-                if ( !empty($_GET['s']) )
-                        $args['search'] = $_GET['s'];
-
-                $categories = get_categories( $args );
-
-                if ( empty($categories) )
-                        return false;
-        }
-
-        $children = _get_term_hierarchy($taxonomy);
-
-        echo _cat_rows( $parent, $level, $categories, $children, $page, $per_page, $count );
-
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
- *
- * @param unknown_type $categories
- * @param unknown_type $count
- * @param unknown_type $parent
- * @param unknown_type $level
- * @param unknown_type $page
- * @param unknown_type $per_page
- * @return string the output of the table.
- */
-function _cat_rows( $parent = 0, $level = 0, $categories, &amp;$children, $page = 1, $per_page = 20, &amp;$count ) {
-
-        $start = ($page - 1) * $per_page;
-        $end = $start + $per_page;
-
-        $output = '';
-        foreach ( $categories as $key =&gt; $category ) {
-                if ( $count &gt;= $end )
-                        break;
-
-                if ( $category-&gt;parent != $parent &amp;&amp; empty($_GET['s']) )
-                        continue;
-
-                // If the page starts in a subtree, print the parents.
-                if ( $count == $start &amp;&amp; $category-&gt;parent &gt; 0 ) {
-
-                        $my_parents = array();
-                        $p = $category-&gt;parent;
-                        while ( $p ) {
-                                $my_parent = get_category( $p );
-                                $my_parents[] = $my_parent;
-                                if ( $my_parent-&gt;parent == 0 )
-                                        break;
-                                $p = $my_parent-&gt;parent;
-                        }
-
-                        $num_parents = count($my_parents);
-                        while( $my_parent = array_pop($my_parents) ) {
-                                $output =  &quot;\t&quot; . _cat_row( $my_parent, $level - $num_parents );
-                                $num_parents--;
-                        }
-                }
-
-                if ( $count &gt;= $start )
-                        $output .= &quot;\t&quot; . _cat_row( $category, $level );
-
-                unset( $categories[ $key ] );
-
-                $count++;
-
-                if ( isset($children[$category-&gt;term_id]) )
-                        $output .= _cat_rows( $category-&gt;term_id, $level + 1, $categories, $children, $page, $per_page, $count );
-        }
-
-        return $output;
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
- *
- * @param unknown_type $category
- * @param unknown_type $level
- * @param unknown_type $name_override
- * @return unknown
- */
-function _cat_row( $category, $level, $name_override = false ) {
-        static $row_class = '';
-
-        $category = get_category( $category, OBJECT, 'display' );
-
-        $default_cat_id = (int) get_option( 'default_category' );
-        $pad = str_repeat( '&amp;#8212; ', max(0, $level) );
-        $name = ( $name_override ? $name_override : $pad . ' ' . $category-&gt;name );
-        $edit_link = &quot;categories.php?action=edit&amp;amp;cat_ID=$category-&gt;term_id&quot;;
-        if ( current_user_can( 'manage_categories' ) ) {
-                $edit = &quot;&lt;a class='row-title' href='$edit_link' title='&quot; . esc_attr(sprintf(__('Edit &amp;#8220;%s&amp;#8221;'), $category-&gt;name)) . &quot;'&gt;&quot; . esc_attr( $name ) . '&lt;/a&gt;&lt;br /&gt;';
-                $actions = array();
-                $actions['edit'] = '&lt;a href=&quot;' . $edit_link . '&quot;&gt;' . __('Edit') . '&lt;/a&gt;';
-                $actions['inline hide-if-no-js'] = '&lt;a href=&quot;#&quot; class=&quot;editinline&quot;&gt;' . __('Quick&amp;nbsp;Edit') . '&lt;/a&gt;';
-                if ( $default_cat_id != $category-&gt;term_id )
-                        $actions['delete'] = &quot;&lt;a class='delete:the-list:cat-$category-&gt;term_id submitdelete' href='&quot; . wp_nonce_url(&quot;categories.php?action=delete&amp;amp;cat_ID=$category-&gt;term_id&quot;, 'delete-category_' . $category-&gt;term_id) . &quot;'&gt;&quot; . __('Delete') . &quot;&lt;/a&gt;&quot;;
-                $actions = apply_filters('cat_row_actions', $actions, $category);
-                $action_count = count($actions);
-                $i = 0;
-                $edit .= '&lt;div class=&quot;row-actions&quot;&gt;';
-                foreach ( $actions as $action =&gt; $link ) {
-                        ++$i;
-                        ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
-                        $edit .= &quot;&lt;span class='$action'&gt;$link$sep&lt;/span&gt;&quot;;
-                }
-                $edit .= '&lt;/div&gt;';
-        } else {
-                $edit = $name;
-        }
-
-        $row_class = 'alternate' == $row_class ? '' : 'alternate';
-        $qe_data = get_category_to_edit($category-&gt;term_id);
-
-        $category-&gt;count = number_format_i18n( $category-&gt;count );
-        $posts_count = ( $category-&gt;count &gt; 0 ) ? &quot;&lt;a href='edit.php?cat=$category-&gt;term_id'&gt;$category-&gt;count&lt;/a&gt;&quot; : $category-&gt;count;
-        $output = &quot;&lt;tr id='cat-$category-&gt;term_id' class='iedit $row_class'&gt;&quot;;
-
-        $columns = get_column_headers('categories');
-        $hidden = get_hidden_columns('categories');
-        foreach ( $columns as $column_name =&gt; $column_display_name ) {
-                $class = &quot;class=\&quot;$column_name column-$column_name\&quot;&quot;;
-
-                $style = '';
-                if ( in_array($column_name, $hidden) )
-                        $style = ' style=&quot;display:none;&quot;';
-
-                $attributes = &quot;$class$style&quot;;
-
-                switch ($column_name) {
-                        case 'cb':
-                                $output .= &quot;&lt;th scope='row' class='check-column'&gt;&quot;;
-                                if ( $default_cat_id != $category-&gt;term_id ) {
-                                        $output .= &quot;&lt;input type='checkbox' name='delete[]' value='$category-&gt;term_id' /&gt;&quot;;
-                                } else {
-                                        $output .= &quot;&amp;nbsp;&quot;;
-                                }
-                                $output .= '&lt;/th&gt;';
-                                break;
-                        case 'name':
-                                $output .= &quot;&lt;td $attributes&gt;$edit&quot;;
-                                $output .= '&lt;div class=&quot;hidden&quot; id=&quot;inline_' . $qe_data-&gt;term_id . '&quot;&gt;';
-                                $output .= '&lt;div class=&quot;name&quot;&gt;' . $qe_data-&gt;name . '&lt;/div&gt;';
-                                $output .= '&lt;div class=&quot;slug&quot;&gt;' . apply_filters('editable_slug', $qe_data-&gt;slug) . '&lt;/div&gt;';
-                                $output .= '&lt;div class=&quot;cat_parent&quot;&gt;' . $qe_data-&gt;parent . '&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;';
-                                break;
-                        case 'description':
-                                $output .= &quot;&lt;td $attributes&gt;$category-&gt;description&lt;/td&gt;&quot;;
-                                break;
-                        case 'slug':
-                                $output .= &quot;&lt;td $attributes&gt;&quot; . apply_filters('editable_slug', $category-&gt;slug) . &quot;&lt;/td&gt;&quot;;
-                                break;
-                        case 'posts':
-                                $attributes = 'class=&quot;posts column-posts num&quot;' . $style;
-                                $output .= &quot;&lt;td $attributes&gt;$posts_count&lt;/td&gt;\n&quot;;
-                                break;
-                        default:
-                                $output .= &quot;&lt;td $attributes&gt;&quot;;
-                                $output .= apply_filters('manage_categories_custom_column', '', $column_name, $category-&gt;term_id);
-                                $output .= &quot;&lt;/td&gt;&quot;;
-                }
-        }
-        $output .= '&lt;/tr&gt;';
-
-        return $output;
-}
-
-/**
- * {@internal Missing Short Description}}
- *
</del><span class="cx">  * @since 2.7
</span><span class="cx">  *
</span><span class="cx">  * Outputs the HTML for the hidden table rows used in Categories, Link Caregories and Tags quick edit.
</span><span class="lines">@@ -2708,7 +2518,7 @@
</span><span class="cx"> ?&gt;
</span><span class="cx"> &lt;/select&gt;
</span><span class="cx"> &lt;input class=&quot;hide-if-js&quot; type=&quot;text&quot; id=&quot;metakeyinput&quot; name=&quot;metakeyinput&quot; tabindex=&quot;7&quot; value=&quot;&quot; /&gt;
</span><del>-&lt;a href=&quot;#postcustomstuff&quot; class=&quot;hide-if-no-js&quot; onclick=&quot;jQuery('#metakeyinput, #metakeyselect, #enternew, #cancelnew').toggle();return false;&quot;&gt;
</del><ins>+&lt;a href=&quot;#postcustomstuff&quot; class=&quot;hide-if-no-js&quot; onClick=&quot;jQuery('#metakeyinput, #metakeyselect, #enternew, #cancelnew').toggle();return false;&quot;&gt;
</ins><span class="cx"> &lt;span id=&quot;enternew&quot;&gt;&lt;?php _e('Enter new'); ?&gt;&lt;/span&gt;
</span><span class="cx"> &lt;span id=&quot;cancelnew&quot; class=&quot;hidden&quot;&gt;&lt;?php _e('Cancel'); ?&gt;&lt;/span&gt;&lt;/a&gt;
</span><span class="cx"> &lt;?php } else { ?&gt;
</span><span class="lines">@@ -3385,7 +3195,7 @@
</span><span class="cx">                                 &lt;?php wp_nonce_field( 'find-posts', '_ajax_nonce', false ); ?&gt;
</span><span class="cx">                                 &lt;label class=&quot;screen-reader-text&quot; for=&quot;find-posts-input&quot;&gt;&lt;?php _e( 'Search' ); ?&gt;&lt;/label&gt;
</span><span class="cx">                                 &lt;input type=&quot;text&quot; id=&quot;find-posts-input&quot; name=&quot;ps&quot; value=&quot;&quot; /&gt;
</span><del>-                                &lt;input type=&quot;button&quot; onclick=&quot;findPosts.send();&quot; value=&quot;&lt;?php esc_attr_e( 'Search' ); ?&gt;&quot; class=&quot;button&quot; /&gt;&lt;br /&gt;
</del><ins>+                                &lt;input type=&quot;button&quot; onClick=&quot;findPosts.send();&quot; value=&quot;&lt;?php esc_attr_e( 'Search' ); ?&gt;&quot; class=&quot;button&quot; /&gt;&lt;br /&gt;
</ins><span class="cx"> 
</span><span class="cx">                                 &lt;input type=&quot;radio&quot; name=&quot;find-posts-what&quot; id=&quot;find-posts-posts&quot; checked=&quot;checked&quot; value=&quot;posts&quot; /&gt;
</span><span class="cx">                                 &lt;label for=&quot;find-posts-posts&quot;&gt;&lt;?php _e( 'Posts' ); ?&gt;&lt;/label&gt;
</span><span class="lines">@@ -3395,7 +3205,7 @@
</span><span class="cx">                         &lt;div id=&quot;find-posts-response&quot;&gt;&lt;/div&gt;
</span><span class="cx">                 &lt;/div&gt;
</span><span class="cx">                 &lt;div class=&quot;find-box-buttons&quot;&gt;
</span><del>-                        &lt;input type=&quot;button&quot; class=&quot;button alignleft&quot; onclick=&quot;findPosts.close();&quot; value=&quot;&lt;?php esc_attr_e('Close'); ?&gt;&quot; /&gt;
</del><ins>+                        &lt;input type=&quot;button&quot; class=&quot;button alignleft&quot; onClick=&quot;findPosts.close();&quot; value=&quot;&lt;?php esc_attr_e('Close'); ?&gt;&quot; /&gt;
</ins><span class="cx">                         &lt;input id=&quot;find-posts-submit&quot; type=&quot;submit&quot; class=&quot;button-primary alignright&quot; value=&quot;&lt;?php esc_attr_e('Select'); ?&gt;&quot; /&gt;
</span><span class="cx">                 &lt;/div&gt;
</span><span class="cx">         &lt;/div&gt;
</span></span></pre>
</div>
</div>

</body>
</html>