[wp-hackers] RE: Reference TermId or TermTaxonomyId for category
jer-wphackers at simianuprising.com
Mon Feb 9 20:53:14 GMT 2009
I would definitely recommend staying with the term_id whenever
possible if you're creating functions that could even conceivably be
used by anyone outside of your plugin.
It's not necessarily better or faster but IMHO your plugin is building
an API and it might as well be as close as possible to the existing
terms API provided by WP, which definitely uses term_id as its base
unit. That's what get_term() accepts, its what you have when you check
global $cat, etc etc.
It's the number that maps onto the old categories system as well (back
when it made sense right away ;)
If your plugin is good people will want to write their own code around
the functions you provide, so you should give them functions that
accept the values they already have on hand: term_id for categories
and slugs for tags.
Code and Design | globalvoicesonline.org
More information about the wp-hackers