List posts taxonomies without knowing what they are in advance
-
I’ve built a Actionscript – AMF – PHP – WordPress bridge, that lets Flash use WordPress as a CMS.
When building what I call a PostVO object, (which is basically a representation of a post within the database with some extra values added on. Which are categories, post_tags, attachments, featured image and permalink) I’ve come across a slight hurdle with getting a list of the taxonomies the post belongs within. I can access them via get_post_taxonomies which gives me a list of possible taxonomies, but not the particular ones associated with a particular post.
get_post_taxonomies is a start, and I can run a for each loop against what this returns, using wp_get_object_terms to check if the post has that particular taxonomy.
But it seems a little inefficient. I can access each posts taxonomies via a SQL query. Ideally however I try to resist working directly on the database and prefer to use the WordPress API.
So, is there a function I can call that returns the taxonomies of a particular post, without knowing what those taxonomies are in advance?
- The topic ‘List posts taxonomies without knowing what they are in advance’ is closed to new replies.