Is there a way to get the list of existing tags from a WordPress blog using AtomPub?

I’d like to be able to query a WordPress blog for a list of existing tags so that they can be offered at the time that a new post is being created. Is this possible through AtomPub with WordPress? I’m finding the documentation for WordPress AtomPub support to be lacking. I’m wondering if this is more of a restriction on AtomPub than on the WordPress implementation.

Related posts

Leave a Reply

1 comment

  1. It seems Atom does not have a concept of “tags”, only “categories”. As AtomPub is based on it, it only specifies a request for categories.

    The WordPress AtomPub implementation calls get_categories() directly, which, of course, defaults to the category taxonomy. However, you can filter the arguments via get_categories_taxonomy, and change the taxonomy argument to an array that includes post_tag. You would of course only enable this filter when there is an AtomPub request.

    When a post is created or updated WordPress only looks at the categories, so you will have to add the non-category terms yourself. You can do this by hooking into the atompub_create_post and atompub_put_post hooks, which get the WordPress post ID and the full entry the client sent, which includes all terms.