[wp-trac] Re: [WordPress Trac] #2328: Provide structured access to
category list
WordPress Trac
wp-trac at lists.automattic.com
Sat Feb 18 23:31:07 GMT 2006
#2328: Provide structured access to category list
-------------------------+--------------------------------------------------
Id: 2328 | Status: new
Component: Template | Modified: Sat Feb 18 23:31:07 2006
Severity: enhancement | Milestone: 2.1
Priority: normal | Version: 2.0.1
Owner: anonymous | Reporter: coppit
-------------------------+--------------------------------------------------
Comment (by majelbstoat):
Let me explain a bit more clearly my position.
Say I would like to return a subset of each category (along with a correct
post count), containing only posts written in 2005. This could easily be
any other filtering parameter (tags, language, author, etc).
Now, with the solution you have provided in place, I am given an array of
all the defined categories plus a full post count for each category, minus
any exclusions I make with list_cats_exclusions. However, I don't want to
exclude whole categories, just parts of each, so list_cats_exclusions
doesn't help.
Using list_cats_cats, I'd be able to look at the array and regenerate a
post count for each category based on my criteria. But, I still might end
up with categories that have 0 posts. I suppose I could use
list_cats_exclusions to exclude those categories but this means
calculating the post count twice, once in each function.
A much better solution, I believe, is a unified one that actually provides
an opportunity to give list_cats a set of categories that the plugin wants
to return, combined with blog author options such as "hide these specific,
private categories and order them by how many posts we have". I can't see
a good solution to this (not particularly uncommon) problem using the
functionality that your patch provides. If you can see an elegant
solution to the problem outlined above using your supplied patch, I'd be
all for it. And, seeing as wp_list_cats is the only function that calls
list_cats, and outputs a structured category list, I believe it is
related.
--
Ticket URL: <http://trac.wordpress.org/ticket/2328>
WordPress Trac <http://wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list