I need to access a list of all categories for a plugin I’m working on, I know that there is the wp_list_categories
template tag for use in themes. What would be the best way of accessing these categories for use in a plugin? Is there a specific function or is it a case of writing a specific query?
Edit: Here’s a screenshot which shows the context of how I’m trying to display a list of categories:
The
get_categories()
function is what you’re looking for.Update: Thanks for the clarifications. Sounds like you’re doing the same thing as this question, ie. creating a new taxonomy for attachments. (I’m not sure they get these categories automatically, maybe someone else can clarify.) I haven’t played with that functionality yet, but does that other post sound like what you’re looking for?