"Beauty exists in the smallest and simplest of things, in the moments that slipped through the cracks of time. We have yet to develop the language to successfully retell it or to recall its memory." – Me, 2014.
15/05/2022
2022/05/15#p2
The function to update a post obviously includes a check to see if it is a draft – if so, and it's staying as a draft, just update it as is. Drafts are stored In the database with slightly different information.
If I change the post status to 'publish' a number of actions should be taken including resetting the published time and date, setting the permalink and giving it the right section number, updating the RSS feed, then sending any webmentions. Only, that last part has never worked.
Webmentions are fine for new posts and the code is an exact duplicate so what gives? There has to be an issue with the logic although, for the life of me, I've never been able to find what that issue is.
I had another look earlier and still couldn't find the problem; all checks were working or else the post would remain as a draft and not get published. So, rather than nest the webmention code within the main status check, I decided to pull it out and set up a totally separate test: if draft equals "yes" and status equals "publish" - simple stuff that does the same check as the existing code.
It works! 1
I don't know what it thinks it's doing differently but I'm glad it is. I've been living with this for over a year, spoofing webmentions manually or copying/reposting items as new just so that the mentions would get sent. Hopefully, I won't have to do that any longer; I just wonder why it's taken me so long to take a different approach to solving the problem.
-
at least it seemed to be okay in my (admittedly limited) testing ↩