[wp-trac] Re: [WordPress Trac] #2328: Provide structured access to
category list
WordPress Trac
wp-trac at lists.automattic.com
Sun Feb 19 09:37:29 GMT 2006
#2328: Provide structured access to category list
-------------------------+--------------------------------------------------
Id: 2328 | Status: new
Component: Template | Modified: Sun Feb 19 09:37:29 2006
Severity: enhancement | Milestone: 2.1
Priority: normal | Version: 2.0.1
Owner: anonymous | Reporter: coppit
-------------------------+--------------------------------------------------
Comment (by davidhouse):
If the count gets down to 0 for any category, just remove it from the
array.
{{{
function adjust_cat_counts($cats) {
foreach ($cats as $k => $cat) {
$cat->category_count = get_cat_count_after_subsetting($cat);
if ($cat->category_count <= 0) {
unset($cats[$k]);
}
}
return $cats;
}
}}}
--
Ticket URL: <http://trac.wordpress.org/ticket/2328>
WordPress Trac <http://wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list