wp-api-v2-client-java
wp-api-v2-client-java copied to clipboard
Improve batch handling of tags
For example, when creating multiple tags on a post, it might be better to create the tags and then set them in a batch instead of updating the post each time a tag is added.
Hi Johan, When I try to create a post with an existing tag, the tag is not associated with the post in wordpress. In the builder, using the function PostBuilder withCategories(Term[] terms) or PostBuilder withCategories(List<Long> categoryIds) don't affect the end result. Can you confirm to me if it is an issue? Thank you
Got it, I can use createPostTag instead. Thank you anyway.
Hi @pborgesalves,
Thank you for your feedback. I will have to take a look. There is a test in which a post is created with a particular category, although you are referring to tags but mention category methods. Tags and Categories are not exactly the same (Categories being hierarchical and Tags not.)
I do see that there's no builder method for Tag/s so I will add that and then I can resolve #6 as well!
Hi @pborgesalves
I have stabilised 4.8.1 that will allow you to use the builder method .withTags(Term... tags)
or .withTags(List<Long> tagIds)
with existing Tag terms.
It will take a while before available on Maven Central.
<dependency>
<groupId>com.afrozaar.wordpress</groupId>
<artifactId>wp-api-v2-client-java</artifactId>
<version>4.8.1</version>
</dependency>