#wordpress 2020-06-23

2020-06-23 UTC
dougbeal|mb1, gRegorLove_, justache, GWG, nickodd, [jgmac1106], [chrisaldrich], [hibs], crazed, [KevinMarks], [grantcodes], wagle, [Steen_Comer], [LewisCowles], [Ana_Rodrigues], [tantek], jasminlopez, jeremych_, [snarfed], [keithjgrant], [jeremycherfas] and [CrowderSoup] joined the channel; nickodd left the channel
#
[CrowderSoup]
Is this a good place to ask questions related to the WordPress Micropub plugin? I'm having some issues with how to add tags to a post via the micropub endpoint. I am making the call from a nodejs service. The function looks like this:
#
[CrowderSoup]
type: ['h-entry'],
#
[CrowderSoup]
```async function likedTweet(inputData) {
#
[CrowderSoup]
let data = {
[CrowderSoup] joined the channel
#
[CrowderSoup]
The issue I'm having is that while the post gets created in wordpress, it doesn't have any "tags", when it should at least have the "like" tag if I'm understanding correctly
[chrisaldrich] joined the channel
#
[chrisaldrich]
What is Micropub?
#
Loqi
Micropub is an open API standard (W3C Recommendation) for creating, editing, and deleting posts on websites, like on your own domain, supported by numerous third-party clients and CMSs https://indieweb.org/Micropub
#
[chrisaldrich]
That looks roughly right, but I'm out of the office at the moment. https://www.w3.org/TR/micropub/ may give you some more specifics about what is expected.
#
[chrisaldrich]
If GWG is around he may see something quickly. You might also ask in the #indieweb-dev channel as it shouldn't be WordPress specific.
#
[CrowderSoup]
Thanks, I'll read through that spec! I am getting back a response that includes `tags_input: ['like']` and `mf2_category:['like']` so I am wondering if I'm missing something specifically, or if I've found a bug in the WordPress plugin. I can ask in #indieweb-dev if it's determined to not be a wordpress specific issue 🙂
#
[chrisaldrich]
If I recall correctly (it's been a while) the one thing specific to tags/categories that is wordpress specific is that the endpoint will look for prexisting categories first and then assign those, it then assigns the others as tags. I don't think micropub differentiates between the two like WordPress does.
#
[CrowderSoup]
ohhh, I don't think I have a `like` category but I will double check. I have WordPress set to make the default category "Notes" though
#
[chrisaldrich]
I think if it doesn't exist already, it should create it as a WordPress tag.
#
[CrowderSoup]
That was my assumption. I do have a 'like' tag already 😕
#
[chrisaldrich]
Were you at least getting the content to post and appear?
#
[CrowderSoup]
Yep, the only thing that doesn't seem to work is the category/tags
#
[CrowderSoup]
Everything else works perfectly
#
[chrisaldrich]
[CrowderSoup] here's the repo with the category sections highlighted: https://github.com/indieweb/wordpress-micropub/search?q=category&unscoped_q=category
[schmarty] joined the channel
#
[chrisaldrich]
So you're not getting any category/tags coming through or you're expecting a category but getting a tag?
#
[CrowderSoup]
I'm not getting any category or tag
#
GWG
Like isnt a category or tag
#
[CrowderSoup]
Should it not create a category or tag called "like" ?
#
GWG
But if you are wanting to make it one as you outlined, it should work as chrisaldrich described...
#
GWG
It tries to match category slug, then tag slug
#
GWG
I can investigate why it isn't...
#
GWG
If we broke something, I might not notice as I don't tag much
#
GWG
But we do unit test that.
#
[chrisaldrich]
I created something similar using a webhook earlier this year. I remember making most of my categories capitalized to make it easier to remember whether the input into micropub would be a category (capitalized) or a tag (not capitalized) https://boffosocko.com/2020/01/21/using-ifttt-to-syndicate-pesos-content-from-social-services-to-wordpress-using-micropub/
#
GWG
[chrisaldrich]: I don't know if we do caseless matching
#
[chrisaldrich]
if it's matching based on the slug, it should always be lower case anyway, right? I just do it as a reminder to myself when inputting things on the Micropub client side.
#
GWG
I can't remember the last time I checked the code for that
#
[chrisaldrich]
I've got almost 10,000 categories/tags on my site and need to clean many of them up (or out)... I have a taxonomy problem.
#
GWG
[chrisaldrich]: Wait till Post Kinds adds citation tags
#
GWG
And Simple Location has region tags
gRegorLove, [LewisCowles], [KevinMarks], tonywok, [chrisaldrich] and [tantek] joined the channel